How does evolution work?
(Lansing State Journal, June 14, 1995)
Sometimes a mutation will have no effect on an organism. Often the mutation will kill the organism. Very rarely will a mutation give an organism an advantage in its environment, such as greater strength or ability to survive longer during starvation. Under extreme conditions, a slight advantage caused by mutation can make the difference between death and survival.
Giraffes, for instance, didn't always have necks as long as they are now. at some time there was a mutation that caused a giraffe to have a longer neck. This trait was passed on and at first there was probably no major advantage to the longer neck. During a time when food was scarce, however, such as during a long drought, the giraffes with the longer necks could reach the higher leaves than the shorter necked giraffes and therefor survived.
The shorter necked giraffes eventually died out because they couldn't compete with the longer necked giraffes. This is just another way of saying giraffes evolved with long necks.