Differentiation of persistent anatomical defensive structures is costly and determined by nutrient availability and genetic growth-defence constraints.