I have a strong belief that Madi is Luna's daughter and that Luna thought Madi had died during s3 when ALLIE's chip overthrew the oil rig which is another reason of why she did not want the human race to survive anymore. After praimfaya was over for the second time Clarke went out to the oil rig looking for any supplies and she found Madi there!