Perfect?
You mean this habitat that regularly snuffs out the inhabitants?
An evolutionary stable system will fall into equilibrium but when something pushes it out of equilibrium, whether it's a bad winter or a texas sized rock falling out of the sky, it's chaotic until it falls back into balance.
Earth didn't change for us, we changed for earth. And if something changes our environment too quickly for us to adapt, we'll be history too.
Just start a list of things you pray for, and see how many actually come true.
And look at the list rationally. If you pray to pass a test and you spend two weeks studying for it, it's not a huge leap to figure out that if you knew the answers to the questions and passed that it was your doing.
If you wrote: "The monkey sniffed it's finger" for all your answers and still passed, you can probably attribute that to prayer, or a teacher under the influence of powerful drugs.