Often portrayed as a simple Darwinian development, it was recently admitted at Nature to be a puzzle:
The giraffe’s neck has long been a beloved icon of evolutionary theory. According to the story, one of the giraffe’s short-necked ancestors had a slightly longer neck, which helped him reach leaves the other animals on the savannah couldn’t. This gave him a survival advantage he passed on to his offspring. Or maybe the female giraffes really dug his slightly longer neck, giving him a reproductive advantage. Same result. He passed his slightly longer neck on to his offspring. Rinse and repeat a few thousand times, and voila, the lineage ends up with 600-pound, six-foot long giraffe necks. – Jonathan Witt (March 13, 2023)
From Nature:
One prevailing theory is that giraffes evolved longer necks to reach higher trees for food. “This is widely believed; it’s really entrenched,” says Simmons…. [But] research has shown that giraffes tend to eat from lower levels, and tall giraffes aren’t more likely to survive drought, when food competition is highest. Another idea is that giraffes evolved longer necks for sexual competition, with male giraffes engaging in violent neck-swinging fights and longer necks attracting mates…. [But] males don’t have longer necks than females.” – Nicola Jones, “How the Giraffe Got Its Neck,” Nature, June 2, 2022, internal references removed. For additional evidence against the “necks for sex” hypothesis, see Byriley Black, “Giraffe Necks Not for Sex,” National Geographic, January 15, 2013.
Much more at the link.