Mining is a dangerous enterprise. Each year more than 100 people die in mining accidents globally. In my home country, Australia, the number of fatalities directly caused by mining has been declining steadily, but the mining industry still has the highest fatality rate of any industry. The reason why mining has not been phased out, despite its obvious dangers, is because it can be enormously lucrative. The wealth of Australia is basically built on the proceeds of mining.

And so it is for Drosophila larvae that find themselves in a resource-poor environment. Under certain conditions, the best option for the fly larvae is to get together and form a cluster that collectively excavates a poor food source so that the larvae can get deeper into the food medium. But as in a human-constructed mine, there is a delicate balance between exploitation and the risk of the tunnel collapsing. The risk of collapse is particularly salient in the case of the Drosophila larvae as the act of feeding, particularly when there are many mouths, weakens the tunnels.

In this issue, Shoot et al. (2024) investigated the decision-making process Drosophila melanogaster larvae go through when faced with food of different quality. Using a clever experimental design, the researchers created environments in which food of high and low quality were offered in isolation, next to each other in a 1:1 ratio, or layered horizontally so that the larvae had to burrow through one layer to reach food of a different quality. Fly eggs were then placed on top of the food and the behavior of the larvae was monitored. Would they form clusters to mine the food or not?

Food quality significantly affected if clusters would form, the size of the clusters, and the way in which the food was exploited. The lower the quality, the more likely clusters were to form and the more narrow the tunnels were. In the experimental set up in which the larvae were given a choice between high- and low-quality food, the scenario in which the food was vertically divided, more clusters formed on the low-quality side. When the food was divided horizontally, clusters constructed more narrow tunnels when the food was overall of low quality; in other words, when the larvae had to tunnel through low-quality food only to find more low-quality food.

It is a tough choice that an individual larva needs to make. Nutrition is essential to the larva’s development and successful metamorphosis, so sharing poor-quality food with others is likely to reduce an individual’s intake, unless working together compensates sufficiently. The experiments by Shoot et al. strongly suggest that the larvae actively trade-off the costs and benefits of working together to access food. As the larvae feed, the stability of the tunnels they construct reduces, so increasing the risk of being killed by their food, or what remained of it. The fly larvae, therefore, not only need to take the initial conditions into account, when deciding to cluster and mine together or not, they also need to decide when to cease exploiting further or modify the tunnel such that the risk of collapse is minimized.

Because Drosophila are not social in the way ants, bees, wasp and termites are, the larvae’s behavior seems to provide an excellent model to study the conditions that push individuals toward cooperation. A system in which cooperative behavior is flexible allows one to play with conditions to pin-point exactly when, how, and why an individual is swayed to behave social instead of going solo.