Summary Many plants engage ants in defensive mutualisms by offering extrafloral nectar (EFN). Identifying sources of variation in EFN quantity (amount) and quality (composition) is important because they can affect ant visitation and identity and hence effectiveness of plant defence. I investigated plant size and reproductive state (vegetative or flowering) as sources of variation in EFN quantity and quality. I focused on Opuntia imbricata and two ant partners, Crematogaster opuntiae and Liometopum apiculatum. I tested the influence of plant size and nectary type (vegetative vs. reproductive structure) on the probability and rate of EFN secretion, concentrations of total carbohydrates (CH) and amino acids (AAs), and relative abundances of constituent CH and AAs. I also examined how traits of individual nectaries scaled up to influence total plant‐level rewards. Parallel observations documented associations between plant demographic state and ant visitation and species identity. EFN quantity and quality were generally greater for larger, reproductive plants. At the scale of individual nectaries, probability of EFN secretion was positively size‐dependent and greater for nectaries on reproductive vs. vegetative structures. Rate of EFN secretion, carbohydrate and amino acid concentrations, and the relative abundance of disaccharide vs. monosaccharide sugars were greater for reproductive nectaries but were unaffected by plant size. Nectary‐level traits scaled up to influence rewards at the whole‐plant level in ways that corresponded to ant visitation: the probability of ant occupancy increased with plant size and reproduction, as did the likelihood of being tended by the superior guard, L. apiculatum. Variability in EFN traits may contribute to changes in ant occupancy and identity across plant sizes and reproductive states. Synthesis. This study provides a thorough examination of how plant investment in biotic defence varies over the life cycle. Explicit consideration of plant demography may enhance understanding of ant–plant mutualisms. Populations of long‐lived plants are demographically heterogeneous, spanning sizes and reproductive states. The rewards offered to animal mutualists can track demographic heterogeneity with consequences for plant defence and the dynamics of multispecies mutualisms.