Long necks allow giraffes to feed on higher vegetation that giraffes with shorter necks cannot reach.
The longer-necked giraffes are faster and less susceptible to predation.
Males compete for the opportunity to mate with females by striking each other with their heads. Males with longer necks deliver more powerful strikes to their opponents than males with shorter necks.
Shorter-necked giraffes have a structurally sounder neck and are more likely to win the head-striking contests, winning the opportunity to mate with a female.