Species richness is influenced both by mechanisms occurring at landscape scales, such as habitat availability, and local-scale processes, that are related to abiotic conditions and plant–plant interactions. However, it is rarely tested to what extent local species richness can be explained by the combined effect of factors measured at multiple spatial scales. In this study, we quantified the simultaneous influence of historical landscape-scale factors (past human population density, and past habitat availability – an index combining area and connectivity) and small-scale environmental conditions (shrub cover, and heterogeneity of light, soil depth, and other soil environmental variables) on plant species richness in dry calcareous grasslands (alvars). By applying structural equation modelling (SEM) we found that both landscape conditions and local environmental factors had significant direct and indirect (i.e. through the modification of another factor), effects on species richness. At the landscape scale, we found a direct positive influence of historical habitat availability on species richness, and indirect positive influence of past human population (via its effects on historical habitat availability). At small scales, we found a positive direct influence of light heterogeneity and shrub cover on species richness. Conversely, we found that small-scale soil environmental heterogeneity, which was mainly determined by soil depth heterogeneity, had a negative effect on species richness. Our study indicates that patterns of species richness in alvar grasslands are positively influenced by the anthropogenic management regime that maintained the landscape habitat conditions in the past. However, the abandonment of management, leading to shrub invasion and increased competition for light resources also influenced species richness. In contrast to the positive heterogeneity–diversity relationship we found that soil heterogeneity reduced species richness. Environmental heterogeneity, occurring at the plant neighbourhood scale (i.e. centimetres), can increase the isolation among suitable soil patches and thus hinder the normal functioning of populations. The combination of previous knowledge of the system with new ecological theories facilitates disentangling how species richness responds to complex relationships among factors operating at multiple scales.