Ecological communities change over time and space, and ecologists have long suggested that biodiversity might influence the rate of change. Here we cast new light on this question by demonstrating statistical covariation between species richness and the variability of species abundances and identities within a community (compositional variability). We provide a new analytical framework for several previously published measures of ecosystem functioning and compositional variability. We derive three related variances, each of which measures compositional variability due solely to stochastic sampling processes. Our analyses show that whether relations between species richness and compositional variability are positive, negative or zero, depends on two factors. Not only does the particular variance used affect the relation, but, more importantly, the underlying determinants of species richness can strongly affect the stochastic relations between species richness and compositional variability. This analysis makes clear for the first time how species richness should correlate with important measures of community variability, even in the absence of systematic processes.