Abstract
The evolution and maintenance of public goods cooperation, despite cheating, remains a key interest in social biology. Identifying how ecological factors determine the direct and indirect benefits that maintain cooperation has proven challenging, as these can vary significantly across species and environments. Here, we study this problem using the social pine sawfly Neodiprion sertifer (Hymenoptera) as a model system. During their larval stage, N. sertifer live in groups and collectively secrete a defensive fluid against predators. This behavior comprises a public good as it is costly to exhibit and beneficial to others, and individuals vary in their contribution to group defense. We experimentally manipulated individual contributions to defense to assess how these influence survival under natural insect predation. Our results indicate that defense has a group-level benefit as individuals were more likely to survive in cooperative groups with a higher proportion of defending larvae. Moreover, being able to deploy defensive fluid confers direct survival benefits. Genetic and phenotypic analyses of natural populations further show that kin selection promotes collective defense, as groups of larvae are often composed of full siblings. We also find that the contribution to defense is female-biased and diminishes in larger, more male-biased groups, and to some extent with decreased kinship, indicating that individuals adjust their contributions based on social context. Overall, we find that contribution to the collective defense provides both direct and indirect benefits and that individuals regulate their contributions mainly based on the social environment, resulting in variation within and among natural populations.