No one would call a baby ant cute. They are not much to look at – the insects start life as unsightly worm-like larvae – and their behaviour is, frankly, terrifying: if they are not vomiting into the mouth of an adult they are greedily devouring each other.

But grown-up ants do not simply tolerate this behaviour in their youngsters – they depend on it. Researchers now suspect that ant larvae play a far-reaching role that is vital to the cohesion of the complex societies they are born into.

"Larvae may be a distinct social caste with a specific function, without which a colony would not work," says Eva Schultner of the University of Regensburg in Germany, who studies the role of developing individuals in ant colonies.

The young of some insects, like termites, are often shaped like mini-adults, complete with tiny legs. Ant larvae are rarely blessed with such features. Their limbless bodies seem to make them incapable of much movement, giving the impression that they are merely passive objects dependent on adult care. They do not even have antennae, which adults use to sense their surroundings and communicate – so biologists once assumed they would not interact with their environment.

However, looks can be deceiving.

Some ant larvae signal to adults that they are hungry by swaying and moving their blobby bodies in distinct ways. Others, like the larvae of bulldog ants, stand upright. Some larvae are actually mobile despite their lack of legs. They can crawl towards insect or worm prey brought to the nest by workers.

Moreover, ant grubs conceal unusual body features. The tiny, elongated heads of developing Myrmecina ants, for instance, are perfectly adapted for feeding. Adults will tear open a mite and present it to the larvae, which then sink their elongated heads into the carcass and consume its contents.

Leptothorax ant larvae have a complementary feature: unique structures on their bellies act as food baskets, allowing them to hold onto their prey.

Some ant larvae have a sound-producing organ that allows them to communicate

A close-up view of many larvae reveals that their bodies are covered with hairs, often specialised for different functions. In wood ants, the hairs act like Velcro, binding larvae to each other so that workers can easily transport them. Older larvae of another ant species, Pheidole rhea, have hooks on the end of their hairs, which allow adults to attach them to the walls of their nests. Workers are thought to hang up the brood as a way of organising them and determining feeding times. Ponerine ants have a similar system except they use sticky, pimple-like structures as hooks.

Hairs may act not only as anchors, though: they may help larvae communicate. Wasp larvae use hairs as their main sensing organ. When in their nests, they can detect vibrations when adults tap on the walls. Vibrational cues are also thought to play a role in determining whether a young wasp develops into a worker or a queen. Hairs might be used in a similar way in ant larvae, says Schultner – although no one has done the studies that would confirm the idea.

Instead of hairs, some ant larvae have a sound-producing organ that allows them to communicate. Karsten Schonrogge from the NERC Centre for Ecology and Hydrology in Wallingford, UK found that, once the outer shell of some Myrmica ant pupae toughens, a specialised organ forms to allow them to make calls. Older ants typically use chemical signals to communicate, but the researchers think that the tough outer skin of pupae may block the secretion of pheromones, encouraging them to resort to sound in order to communicate. Rubbing noises seem to convey a high social status since larvae that belong to a lower class are mute.

Some ant larvae have physical features that benefit the entire colony. Larval weaver ants produce silk to spin their cocoons, but adults also use the silk to construct their nests. It is mostly female larvae that are recruited for this task, which suggests division of labour among larvae.

Meanwhile, during floods some ant species exploit the natural buoyancy of their larvae to help save the colony. Formica selysiants physically link together to form rafts in order to survive the deluge. Larvae, which float more easily, are always placed on the raft base – and despite the risky position they usually survive.

Amblyopone silvestrii ants will puncture a larva's skin to access ducts on its abdomen and drink its blood, vampire style

Larval behaviour may be even more bizarre than their little-known physical features. For example, they often act as "communal stomachs" . Adults have such a thin waist that they can only consume fluids. Larvae eat insects on behalf of the adults and then produce a protein-rich liquid for their elders to eat.

Larvae food-processing tactics can vary. Young poneromorph ants, for example, start digesting insects externally using saliva, before ingesting them and regurgitating the digested remains into a worker's mouth. The worker, in turn, feeds the spewed-out protein to its queen, which is vital for her to produce eggs.

Other larvae, such as those of the ant species Pheidole spadonia, help the adults process food in a slightly different way. In one experiment, biologists discovered that the worker ants rely on the larvae to soften up prey. The workers dismembered fruit flies and then placed the small, tough body parts under a larva's mouth, in grooves specialised for holding food. The larva would then drool on the fly remains, coating them with saliva that digested and softened the tissue. Sometimes the larva pierced the food with its jaws, to allow digestive enzymes to penetrate and speed up the process. Eventually, workers suck up the soft tissue and feed some of it back to the larva.

Ant larvae sometimes provide for the adults in an even more macabre way. Amblyopone silvestrii ants will puncture a larva's skin to access ducts on its abdomen and drink its blood, vampire style. These ants prey on large centipedes, which are not always available, so biologists think their blood-sucking behaviour is an adaptation to supplement their diet. Other Amblyopone ants squeeze a larva's neck to extract drops of saliva. Solenopsis ants pinch a larva's rear end to release milky-looking anal droplets full of recycled nutrients.

Larvae were in fact delaying worker reproduction

Dead larvae can also be eaten whole, as long as they have not died as the result of a contagious disease. And in more extreme cases, when there are food shortages, larvae may have to take one for the team: they are killed and eaten. "They are ready-made protein packages available in a colony," says Schultner. "If a queen is at risk of starving, she will be fed larvae or pupae."

By playing a key role in supplying food, larvae have control over the reproductive success of the colony. Since a queen needs protein provided by grubs to produce eggs, her fecundity increases when more larvae are around. Moreover, with pharaoh ants (Monomorium pharaonis), larvae seem to actively choose which adults to donate secretions to, so as not to frivolously give away nutrients. They readily hand over their juices to mature queens that have mated, but deny them to young, sexually active queens and virgins. Chemical signals may help them assess a queen's fecundity.

Larvae can regulate reproduction in other ways, too. Although worker ants can usually produce their own offspring, they typically hold off when a queen is around and look after her eggs instead. Jessie Ebie from Arizona State University in Tempe and her colleagues wanted to find out how Novomessor cockerelli workers, which live in colonies spread out over many unconnected nests, know that there is a fertile queen somewhere in the system without having contact with her.

Workers produce eggs that look identical to the queen's eggs, so Ebie and her team initially suspected that a chemical marker on the queen's eggs helped make the distinction clear and encourage the worker ants to stop laying their own eggs. "We were surprised to find that it wasn't the eggs," says Ebie. "Larvae were in fact delaying worker reproduction."

When workers were surrounded by queen-produced eggs, they continued to lay eggs as normal. But when the queen's larvae were present, the workers held off.

Larvae may also be able to cannibalise intruders

Ebie is now trying to solve the mystery of how larvae inhibit offspring production. They could be releasing pheromones, or workers might simply become depleted of nutrients they need to reproduce after supplying larvae with food. "Workers produce eggs that aren't viable to feed larvae and the queen," says Ebie.

However, the most enigmatic behaviour of all may be cannibalism. Ant larvae will sometimes eat other larvae – a perplexing behaviour for a social species where cooperation and self-sacrifice usually rule. "Cannibalism is one of the most obvious selfish behaviours," says Schultner.

In a recent study, Schultner and her team investigated whether cannibalistic larvae could be helping their close relatives. Ant colonies can be made up of groups of ants that are not closely related, sometimes bringing together hundreds or thousands of different families. The researchers suspected that larvae may be more likely to dine on individuals who are distant relatives rather than close cousins. Getting rid of unrelated offspring would help their family take over the colony.

By comparing eight species of ants with a range of relatedness in their colonies, Schultner and her colleagues found that levels of cannibalism among larvae were lower in nests housing close siblings. This suggests larvae are able to distinguish between close and less-close relatives – although how they do this is unclear.

"They are capable of assessing their environment and reacting differently to different social contexts," says Schultner. Male larvae were also more likely to practise cannibalism compared to females, although again, it is still a mystery why this should be so.

Larvae may also be able to cannibalise intruders. Many ants are social parasites and will establish a new colony by stealing another species' home. A young queen will typically enter a foreign nest and lay her eggs, tricking the resident workers to rear them. Over time, her offspring will take over.

A thriving ant colony is usually the product of its humble larval origins

Schultner and her team are now keen to find out whether larvae are able to help defend their homes through cannibalism. Since an invading queen typically is not attacked and killed directly, they suspect that host larvae could be fighting undercover by targeting her eggs instead. "We noticed that larvae seem to react differently to different types of eggs, so maybe they recognise the parasite eggs and eat them," says Schultner.

Preliminary results seem to support their hypothesis. But figuring out how the larvae can tell eggs apart will be the next challenge. Adults use their antennae to sense their surroundings, including picking up smells, but larvae do not have feelers or odour-detecting organs. The larvae of some other insects have smell receptors elsewhere on their bodies – and it is possible ant larvae might follow this pattern. "It implies that they can assess their chemical environment," says Schultner.

Larvae may shed their many powers as they mature into majestic adult ants, but their childhood leaves its mark. For example, baby ants learn the odour of their nestmates early on, which seems to influence their ability to recognise colony members as adults. Their nutrition and environment as larvae also influences whether they will become workers or queens – and they reach their maximum body size before adulthood.

In fact, in many ways the future of the colony – and of its descendants – depends on larvae. What happens to larva during their development can generate characteristics that are passed to new generations through natural selection. A thriving ant colony is usually the product of its humble larval origins.

"It's not so important what they do as adults," says Schultner. "What they do during development will influence their success later in life."

Join over six million BBC Earth fans by liking us on Facebook, or follow us on Twitter and Instagram.

If you liked this story, sign up for the weekly features newsletter called "If You Only Read 6 Things This Week". A handpicked selection of stories from BBC Capital, Culture, Earth Future and Travel, delivered to your inbox every Friday.