The relationship between biological diversity and ecological stability has fascinated ecologists for decades. Determining the generality of this relationship, and discovering the mechanisms that underlie it, are vitally important for ecosystem management. Here, we investigate how species richness affects the temporal stability of biomass production by re-analyzing 27 recent biodiversity experiments conducted with primary producers. We find that, in grasslands, increasing species richness stabilizes whole-community biomass but destabilizes the dynamics of constituent populations. Community biomass is stabilized because species richness impacts mean biomass more strongly than its variance. In algal communities, species richness has a minimal effect on community stability because richness affects the mean and variance of biomass nearly equally. Using a new measure of synchrony among species, we find that for both grasslands and algae, temporal correlations in species biomass are lower when species are grown together in polyculture than when grown alone in monoculture. These results suggest that interspecific interactions tend to stabilize community biomass in diverse communities. Contrary to prevailing theory, we found no evidence that species' responses to environmental variation in monoculture predicted the strength of diversity's stabilizing effect. Together, these results deepen our understanding of when and why increasing species richness stabilizes community biomass.