Divine evolution: God didn't make man perfect on his first try. He made a functional being and then after many tweaks over a few thousand years, here we are!
The same could be said about Earth. Every star is a failed attempt at making a stable ecosystem.