"In the High and Far-Off Times the Elephant, O Best Beloved, had no trunk. He had only a blackish, bulgy nose, as big as a boot, that he could wriggle about from side to side..." Rudyard Kipling

The elephant got its trunk, the story goes, because one small elephant child was so curious as to what a hungry crocodile ate for dinner that he got too close to it. The crocodile then bit and pulled its bulgy nose and stretched it out.

From then on, the elephant child was able to stuff large bundles of grass into its mouth with ease.

The truth, of course, is likely to be different to Rudyard Kipling's elephant child story.

And now researchers have sought to understand exactly what that is; and establish why elephants and giraffes have such long trunks and tongues.

 

The answer lies with the amount of food they need to eat, a new study suggests. It's published in the journal Acta Zoologica.

A team modelled how the tongues and trunks of 18 species of herbivore related to the amount of food they took in while grazing.

The soft body parts – the lips tongues and trunks - are the key to their survival

The elephant's trunk, they found, was vital for it to eat enough food in relation to the size of its mouth. So too was the giraffe's tongue. They also helped the herbivores eat softer, more nutritious plants such as leaves. 

The team used a modelling process called allometric scaling, a well-known biological "law" which states that the size of an animal is in proportion to how much it eats.  

"We observed that they ate much more than you would predict on the basis of their mouth volume and skull dimensions," explains one of the study's co-authors, Fred de Boer of Wageningen University in the Netherlands.

"Basically the soft body parts - the lips tongues and trunks - are the key to their survival, otherwise they could not take in sufficient food," adds de Boer.

How much they can bite in one go (bite volume) is therefore a direct result of these elongated soft mouth parts. Smaller herbivores such as an antelope do not need a large tongue to eat enough food.

Not only are these structures key to the survival of today's elephants and giraffes, the team further proposes that they evolved as a direct adaptation to the quality of edible plants in their environment.

It may also explain why some larger herbivores went extinct, says de Boer. During times of sudden climate change, when food became scarcer or less nutritious, other species may have lacked suitable tongues or trunks to eat enough food to survive.

However, as soft tissue is not preserved in the fossil record, other researchers maintain there's more to how tongues and trunks developed.

Palaeontologist William Sanders from the University of Michigan, US, is not convinced that this new analysis answers other aspects of herbivore development which could have played equally important roles in tongue and trunk evolution.  

The size of an animal's teeth, how it replaces them in its mouth, and how an animal's guts work, would all influence how it eats, and have an impact on the evolution of trunks or tongues.

"Skulls, faces and mouths are formed of interrelated anatomical complexes, and that evolution of one part of these complexes will almost always have an effect on the others," he says.

About eight million years ago, elephant ancestors relied heavily on grazing from the ground but they had two sets of elongated tusks which prevented them from eating with only their mouths.

The elephant trunk, he says, evolved to such a length to accommodate its large tusks.

So in one aspect of his story Kipling was not so far off after all. The elephant child certainly could eat more with its elongated trunk as can all other elephants alive today. 

Follow Melissa Hogenboom and BBC Earth on twitter.