in a common Neotropical species, we tested if task-related worker differentiation is more widespread in stingless bees, the largest group of eusocial bees (>500 described species18). To this end, we compared the morphology of nest guards and foragers of 28 species from different areas in Brazil. We chose species that are both relatively common and ecologically varied: they show diversity in their habitat (e.g., savanna, subtropical forests, and tropical rain forest) (see Supplementary Table 1), nesting habits (ground nesting, cavity nesting, and exposed nests)19, foraging method (e.g., pollen foraging, necrophagous, and cleptoparasitic)20 and colony size (from a few hundred to tens of thousands of workers)21,22. We focused on nest entrance guards and foragers because worker differentiation in ants and termites (and the stingless bee T. angustula) mostly involves morphological adaptations for defence and foraging5,6,9,23. Furthermore, we scrutinized existing hypotheses that might explain the evolution of worker sub-castes. Our results show that worker differentiation is indeed common in Neotropical stingless bees and that the evolution of nest-entrance guards of increased body size is linked to the risk of being attacked by parasitic robber bees.ResultsDifferences between guards and foragersWe found that guards were significantly larger than foragers in 10 out of 28 species (in 6 of 16 genera) (Fig. 1a; Table 1 and Supplementary Table 1). The species with larger guards had an overall greater worker size variation (phylogenetically controlled generalized least squares (GLS): t-value = 2.27, df = 26, P = 0.03). In several species, the size difference between guards and foragers was larger than one standard deviation of within colony worker size variation (i.e., differentiation index DI > 1, Table 1, Supplementary Fig. 1). The three species with the largest degree of size differentiation, T. angustula (DI = 1.6), Tetragonisca fiebrigi (DI = 1.54) and Frieseomelitta longipes (DI = 1.35) show a bimodal size distribution (Fig. 1b, c; Supplementary Fig. 1). In the other seven species with worker size differentiation, guard, and forager sizes show considerable overlap (Fig. 1d, e; Supplementary Fig. 1).Figure 1Comparison of guards and foragers in 28 species of stingless bees. a Phylogenetic reconstruction based on a previously published phylogeny18. The color gradient from blueto red indicates the probability that a species evolved increased guard size, based on 1,000 simulations using a Bayesian framework. Numbers 15 indicate independent appearances of increased guard size. b Tetragonisca fiebrigi guards standing on the wax entrance tube (Photo: C. Gruter). c Size-frequency distribution of T. fiebrigi foragers and guards showing a bimodal distribution. Values (unit = mm) are centred for each colony (colony mean and total mean = 0) to correct for overall colony differences (N = 58 forager/65 guards/6 colonies). d Frieseomelitta flavicornis guard and forager (Photo: C. Gruter). e Size-frequency distribution of F. flavicornis foragers and guards, showing a unimodal distribution. Values (unit = mm) are centred for each colony (N = 37/39/6). f Head of a Frieseomelitta variaforager and guard (Photo: C. Gruter). g Melanization frequency distribution of F. variaguards and foragers. Values (unit = melanization level, see methods) are centred for each colony (N = 30/56/6)Full size imageTable 1: