Technically, the baby Elizabeth was already conceived and pregnant in some woman while Danafor Elizabeth was still alive. So either the curse or whatever already knows when Liz will die and already had another Liz being born already soon. That, or whenever she dies, she immediately takes over some random baby somewhere and the baby becomes Liz.