system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5:How does evolution work?

For example if a horse wanted to eat the leaves off branches it couldn't reach, how did it have the biological ability to grow a neck high enough so that it eventually could over millions of years? Does the brain pass slightly different genetical information when mating over a long period of time until it eventually becomes a giraffe?
gpt
Eh no. Imagine a creature. And let's call it a horse. Imagine bigger horses are more likely to survive. They are stronger, faster, and more likely to survive to pass their genes. So majoirty of horses that survives during the milions of years are bigger. Now imagine horses with certain pigmentation of skin are more likely to survive (let's say their main predator doesn't like the collor). Soo majority of horses that survives will have that color.

Now imagine that horses that in famine ridden parts of the world are more likely to survive if they start to eat a certain herb that creates a specific substance in their stomach together with meat. Over the generations horses that are able to consume more herbs, together with the little meat they find are more likely to survive. Soooo only horses that are able to do those things survive. Now let's say that horses that are big enough, so they can reach higher on tree's get the best herbs. Sooo horses that can reach that far, are more likely to survive than .....

And if you do this again and again and again. For milions and milions of years. You will find that the organisms best suited for that particular enviroment evolve to be best suited (more or less) for that particular enviroment. Evolution is guided through natural selection.