Many factors, including climate, resource availability, and habitat diversity, have been proposed as determinants of global diversity, but the links among them have rarely been studied. Using structural equation modeling (SEM), we investigated direct and indirect effects of climate variables, host-plant richness, and habitat diversity on butterfly species richness across Britain, at 20-km grid resolution. These factors were all important determinants of butterfly diversity, but their relative contributions differed between habitat generalists and specialists, and whether the effects were direct or indirect. Climate variables had strong effects on habitat generalists, whereas host-plant richness and habitat diversity contributed relatively more for habitat specialists. Considering total effects (direct and indirect together), climate variables had the strongest link to butterfly species richness for all groups of species. The results suggest that different mechanistic hypotheses to explain species richness may be more appropriate for habitat generalists and specialists, with generalists hypothesized to show direct physiological limitations and specialists additionally being constrained by trophic interactions (climate affecting host-plant richness).