The caterpillar-like larva of the common pine sawfly is known for its dramatic self-defence: groups of larvae simultaneously vomit drops of sticky goo at predators. Now, scientists have learnt why some larvae are ‘cheats’, taking advantage of their comrades’ efforts while not joining the fight.

To understand why some larvae free-ride and others cooperate, Carita Lindstedt at the University of Jyväskylä in Finland and her colleagues prodded larval sawflies (Diprion pini) once a day for about 20 days to elicit the regurgitation defence. The team found that for the larvae, producing the anti-predator upchuck from their pine-needle diet is costly. Larvae that vomited often had less-robust immune systems and were less likely to survive to the pupal stage than their undisturbed peers.

Larvae that were repeatedly forced to mount a defence were also more likely to cheat, perhaps to save energy. Compared to females, male larvae had a greater tendency to freeload — and such cheaters grew faster than male larvae that joined in the communal defence.