Variation in infection risk and transmission potential are widespread in human and wildlife diseases and play a central role in host–pathogen dynamics. To explain this variation, most studies focus on linking host traits to differences in pathogen exposure, infection, and transmission, but typically do not account for hosts’ social context. Yet, an individual’s risk of acquiring infection is likely influenced jointly by their own traits and their social environment. Here, we use 3 natural genotypes of the fruit fly Drosophila melanogaster to test how variation in pathogen transmission is linked to differences in host behavior and social context. We constructed groups of 12 flies from 1 of 3 different genotypes and 5 different sex ratios (0%, 33%, 50%, 67%, or 100% female) in a fully factorial design. To each group, we added a male or female “primary case” fly that had been exposed to the generalist fungal entomopathogen Metarhizium robertsii. We then recorded groups’ aggregation behavior, mating frequency, and infection prevalence. Aggregation and mating behavior were influenced either jointly or additively by fly genotype and sex ratio. However, a combination of individual-level (mating history; the sex of the primary case) and group-level factors (sex ratio) jointly influenced individuals’ infection risk. There were more infections in female-biased groups, though the sex of the primary case also influenced sex-biased mortality and the relationship between individuals’ mating history and infection risk. Thus, an individual’s social environment can be an important predictor of social dynamics and their survival outcomes.

This article is published and distributed under the terms of the Oxford University Press, Standard Journals Publication Model (https://academic.oup.com/journals/pages/about_us/legal/notices)