Evolution by natural selection needs three conditions to be satisfied: variation, heredity, and competition (also called differential fitness).
- There must be variation in a population of a certain species. We can use giraffes as an example. Maybe some giraffes have longer necks and some have shorter necks.
2. These variations must be heritable, meaning that the children of the species will look like their parents. If two long necked giraffes mate, they will produce a long necked baby giraffe.
3. There must be competition between members of the population. Let's say there is a tree that feeds our population of giraffes. Short necked giraffes only have access to the lowest leaves, while long necked giraffes have access to the whole tree. Long necked giraffes have a better chance of feeding, living longer and producing more offspring than short necked giraffes. In other words, they are fitter.
So, over time, genes which produce long necks are favored, naturally selected by these three conditions, and will increase their proportion in the population. Given long enough, this gene may fixate, meaning it is present in 100% of the population.