Empedocles had the idea of chance combinations of organs arising and dying out because of their lack of adaptation. Aristotle , a Greek philosopher who contributed many works in the sciences, believed that there is purpose in the workings of nature, and mistakes are also made. He thought that nature working so perfectly is a necessity. Aristotle believed that nature is everything in the environment, like the sky rains, and the plants grow from the sun. Aristotle's theory fits very well with natural selection.
Natural selection makes it necessary that animals and nature fit perfectly.
If they didn't, then that specific organism would die out, weeding out the characteristics that were unfit for that environment. That same organism's species might evolve over time and acquire adaptations suitable for the environment, so that newly evolved species can survive and flourish with offspring. Then with the organism developing characteristics that might make for survival in the environment, the organisms that don't have favorable characteristics are incapable of survival and disappear. These ideas from Greek scientists are all theories, of course, but the fossil evidence suggests that species evolved over time.