Giraffes are herbivores and occupy the savannas of Africa. These savannas were dominated by Acacia trees, a very small breed of tree.
Leaves were what comprised most of a giraffe's diet. However, the giraffes were unable to feed on the tree's leaves as they were unable to reach the low levels of the tree.
This meant that the giraffes with the short necks were able to consume their diet while the taller giraffes were unable to do so. This resulted in the taller giraffes dying as they did not consume their much-needed diet.
This meant that when the surviving giraffes were sexually mature they reproduced passing their short-necked geneS on to their offspring.
Gradually over time, the short-necked giraffes would reproduce creating a dominant short-necked giraffe population.