The size–complexity hypothesis is a leading explanation for the evolution of complex life on earth. It predicts that in lineages that have undergone a major transition in organismality, larger numbers of lower-level subunits select for increased division of labour. Current data from multicellular organisms and social insects support a positive correlation between the number of cells and number of cell types and between colony size and the number of castes. However, the implication of these results is unclear, because colony size and number of cells are correlated with other variables which may also influence selection for division of labour, and causality could be in either direction. Here, to resolve this problem, we tested multiple causal hypotheses using data from 794 ant species. We found that larger colony sizes favoured the evolution of increased division of labour, resulting in more worker castes and greater variation in worker size. By contrast, our results did not provide consistent support for alternative hypotheses regarding either queen mating frequency or number of queens per colony explaining variation in division of labour. Overall, our results provide strong support for the size–complexity hypothesis.