Introduction

The relationship between biodiversity and the temporal stability of ecosystems has been long debated1,2,3,4. Empirical studies have generally demonstrated positive diversity-stability relationships5,6,7,8, and various mechanisms have been proposed to explain the stabilizing role of biodiversity9,10,11,12,13. In the theory of Thibaut & Connolly9, the temporal stability of an ecological community (Scom), i.e., the inverse variability of some aggregate feature of the community such as its total biomass, is determined by two components (Fig. 1a): the temporal stability of species populations comprising the community (a species-averaged population stability, Spop), and the nature of the synchrony or asynchrony between the fluctuations of distinct species. An integrated metric, denoted Φ, was proposed by Loreau & de Mazancourt14 to measure community-level asynchrony, so that Scom = ΦSpop. The effect of biodiversity on population stability can be positive, neutral, or negative7. But the influence of biodiversity on the strength of synchrony is generally negative, resulting in a positive effect of diversity on Φ and an overall typically positive effect of diversity on community-level stability because of the stabilizing effects of asynchrony7,15,16,17.

Fig. 1: Diagram illustrating how biodiversity influences community stability via its effects on species-averaged population stability and species asynchrony.
figure 1

Empirical studies show that biodiversity may increase or decrease population stability, but it generally promotes asynchrony (a; adapted from Xu et al.7). Asynchrony can be further decomposed multiplicatively into an effect of compensatory dynamics (CPE) and a statistical-averaging effect (SAE; b). We assessed how biodiversity separately alters CPE and SAE.

Synchrony or asynchrony among species in a community relates closely to several terms/concepts appearing commonly in the literature, including compensatory dynamics18, statistical averaging and the portfolio effect5,19,20,21, and the variance ratio22,23. “Compensatory dynamics” here refers to negative temporal covariances among populations, so that decreases in the biomass of one species are offset by increases in other species, thereby stabilizing aggregate community biomass18. Such negative covariances typically arise either from differential responses of diverse species to environmental variations, or from competition among species12,18. In the literature, a classic approach to detect compensatory dynamics is the variance ratio (usually denoted as φ), which compares the variance of the aggregate community to the expected variance under the assumption of independent population fluctuations22,23. Some authors have interpreted φ > 1 to indicate dynamics which are, on balance, synchronous among populations, whereas φ < 1 has been interpreted to indicate compensatory dynamics. In contrast, “statistical averaging” or the “portfolio effect” refers to the fact that a community consisting of many independently fluctuating (zero correlation) species tends to be more stable than a community consisting of few such species20, primarily a statistical mechanism. Though some have used the terminology “portfolio effects” in alternative ways that differ slightly with respect to whether joint responses of species to the environment are included11,12,19,21, we here use the term as specified above, revisiting this issue below and in the Supporting Information and showing that our conclusions are qualitatively the same for alternative definitions (see Results, Discussion, and Methods section).

The measure of asynchrony, Φ, conflates the effects of compensatory dynamics (henceforth called the “compensatory effect” and denoted as CPE) and the effects of statistical averaging (henceforth denoted SAE); these effects have not typically been explicitly separated. Several recent studies have reported that the positive diversity-stability relationship was largely determined by species asynchrony7,15,16,17,24,25,26,27, i.e., a positive association between diversity and Φ. However, it remains unclear whether this pattern is primarily a statistical phenomenon (SAE) or due to a biological mechanism (CPE). Moreover, recent studies focused on how community stability was altered by external drivers, e.g., grazing15, eutrophication24,25, and drought26. It is claimed that these drivers altered community stability by changing species asynchrony. Again, it remains unknown whether statistical averaging or compensatory dynamics were altered. This is particularly important for uncovering how community stability is maintained or reduced, to help inform ecosystem conservation and restoration efforts. It is also a key scientific question considering the long-standing controversy of the relationship between biodiversity and stability and the underlying mechanisms3,9,12,19. Here, we ask whether biodiversity promotes asynchrony, and therefore community stability, principally by promoting CPE or SAE (Fig. 1b). Especially because compensatory dynamics depends on aspects of the biology of interacting species, whereas statistical averaging is primarily a statistical effect, answering this question is essential for a deeper understanding of the mechanisms underlying the diversity-stability relationship. According to our results, the positive relationship between SAE and diversity primarily accounts for the stabilizing effects of biodiversity on community stability.

Results

Theoretical framework

The equation Scom = ΦSpop has been used as follows in much past research15,24,28 to understand whether diversity promotes community stability principally by promoting population stability or asynchrony: (1) Scom, Φ, Spop and diversity are computed in several experimental or observed ecosystems; (2) Scom, Φ, and Spop are plotted against diversity; and (3) regression slopes for Φ and Spop are compared to judge the relative importance of the pathways of Fig. 1a. We developed an extension of this framework to determine whether compensatory or statistical averaging effects are the principal mediator of diversity effects on asynchrony and thence on community stability. The extended framework is Scom = (CPE)(SAE)Spop, where Φ = (CPE)(SAE). The formal definitions of CPE and SAE are in Methods, where the new equations above are also derived. By expressing asynchrony as the product of compensatory and statistical averaging effects, these equations clarify an intrinsic link between three mechanisms which previously have largely been studied separately. We assessed the contribution of the pathways in Fig. 1b using plots of CPE, SAE, and Spop, computed in collections of experimental or observed ecosystems, against diversity.

Lastly, we proposed a framework to further decompose CPE into effects due to differential responses to environmental perturbations (CPEenv) and effects due to species interactions (CPEint). This secondary decomposition allows our theory to encompass the alternative definition of portfolio effects mentioned in the Introduction (see also Discussion), and makes it possible to show that our main conclusions are robust to the definition used. The alternative definition turns out to equal SAE × CPEenv (Methods section).

Empirical analyses

Our approach was applied to two empirical datasets (Table 1): a plant survey dataset containing nine sites at which long-term survey were carried out on natural grasslands10; and a biodiversity-manipulated experimental dataset containing two long-term experiments (BigBio and BioCON) for which plant species numbers were manipulated.

Table 1 Summary of datasets

In the plant survey dataset, the statistical averaging effect, SAE, was the principal mediator of the diversity-stability relationship, not the compensatory effect, CPE. Community stability was strongly positively associated with species richness (Fig. 2a), due principally to a strong positive association between SAE and richness (Fig. 2e) leading to a strong positive relationship between asynchrony and richness (Fig. 2c). Neither CPE (Fig. 2d) nor population stability (Fig. 2b) was significantly related to richness. Though both SAE and CPE were significantly associated with community stability (Fig. 3), the differences in association of these variables with diversity (Fig. 2) means that the effects of diversity on community stability was mediated by SAE, not CPE. Similar patterns held when other biodiversity indices were used in place of richness, e.g., Shannon’s index (Supplementary Fig. 1), and the inverse of Simpson’s index (Supplementary Fig. 2).

Fig. 2: Effects of species richness on community stability and its components across the nine sites in the plant survey dataset.
figure 2

Relationships between species richness and a community stability (p = 0.014), b population stability (p = 0.388), c asynchrony (p = 0.021), d the compensatory effect (p = 0.320), and e the statistical-averaging effect (p = 0.002) are shown. The abbreviations of the site names are around the points (see Table 1 for full names). All values are log10 transformed. Error bars: standard error (log10 transformed) across plots within each site. The ordinary linear regression model was used to test significance. Black lines: regressions through averages, dashed = non-significant at the 0.05 level. Shaded area: 95% confidence bands. *p < 0.05, **p < 0.01, ***p < 0.001. Note that slopes on d and e add to the slope on c, and the slopes on c and b add to that on a, except for rounding error.

Fig. 3: Relationships between community stability and its components across the nine sites in the plant survey dataset.
figure 3

The components include: a population stability (p = 0.187), b asynchrony (p < 0.001), c the compensatory effect (p = 0.009), and d the statistical-averaging effect (p = 0.017) across the nine sites in the plant survey dataset. All values are log10 transformed. Error bars: standard error (log10 transformed) across plots within each site. Regression and significance results formatted as in Fig. 2.

In the biodiversity-manipulated experimental dataset, SAE was again the crucial mechanism behind positive diversity-stability relationships, when such relationships occurred. For both BigBio and BioCON, SAE showed strong positive relationships with species richness (Fig. 4e). However, relationships between CPE and richness were either negative or only slightly positive (Fig. 4d), so that the combined positive effect of diversity on asynchrony (Fig. 4c) was driven primarily by the SAE effect. Negative effects of richness on population stability (Fig. 4b) then further counteracted the SAE mechanism, yielding overall relationships between diversity and community stability which were positive primarily because of the SAE mechanism (BigBio); or which were slightly negative, and would have been much more negative were it not for the SAE mechanism (BioCON) (Fig. 4a). Though community stability was positively related with all three of its constituents (SAE, CPE, and population stability; Fig. 5), the negative or only slightly positive relationships of CPE and population stability with diversity meant that only SAE contributed substantially to positive diversity-stability relationships, when the latter occurred. Similar patterns were found using other biodiversity indices (Shannon index, Supplementary Fig. 3; inverse Simpson’s index, Supplementary Fig. 4).

Fig. 4: Effects of species richness on community stability and its components in the biodiversity-manipulated experimental dataset.
figure 4

Relationships between species richness and a community stability (p < 0.001 for BigBio and p = 0.641 for BioCON), b population stability (p = 0.021 for BigBio and 0.002 for BioCON), c asynchrony (p < 0.001 for BigBio and p = 0.001 for BioCON), d the compensatory effect (p < 0.001 for BigBio and 0.231 for BioCON), and e the statistical-averaging effect (p < 0.001 for both studies) for BigBio (blue) and BioCON (orange) are shown. All values are log10 transformed. Regression and significance results formatted as in Fig. 2. Note that slopes on d and e add to the slope on c, and the slopes on c and b add to that on a, except for rounding error.

Fig. 5: Relationships between community stability and its components in the biodiversity-manipulated experimental dataset.
figure 5

These components include: a population stability (p < 0.001 for BigBio and BioCON), b asynchrony (p < 0.001 for both studies), c the compensatory effect (p < 0.001 for BigBio and p = 0.006 for BioCON), and d the statistical-averaging effect (p < 0.001 for BigBio and p = 0.019 for BioCON) within two studies (indicated by different colors). All values are log10 transformed. Regression and significance results formatted as in Fig. 2.

We applied our secondary decomposition approach (i.e., further decomposing CPE into CPEenv and CPEint; see Methods and Supplementary Fig. 5) to the two empirical datasets. In the plant survey dataset, CPEenv and CPEint were only modestly positively associated with diversity (Supplementary Fig. 6a, b). Similarly, in the biodiversity-manipulated experimental dataset, CPEenv and CPEint were either negatively associated with richness or were modestly positively associated with it (Supplementary Fig. 7a, b). As a result, the SAE dependence on diversity was stronger and was still the primary mechanism of positive diversity-stability relationships in these systems. For both datasets, the dependence of SAE × CPEenv (corresponding to the alternative definition of portfolio effects; Supplementary Figs. 6c, d and 7c, d) on diversity was substantially stronger than the dependence of CPEint on diversity (Supplementary Figs. 6b and 7b).

Discussion

Recently, many studies have attributed the stabilizing effect of biodiversity to its enhancement of between-species asynchrony7,15,16,17,24,25,26,27. Asynchrony is a different concept from compensatory dynamics, though these terms are sometimes used interchangeably7. We developed a framework for illustrating that asynchrony can arise from both compensatory dynamics and statistical-averaging effects, and for isolating the contributions of these effects. Our analyses of grassland communities show that the statistical-averaging effect matters much more than compensatory dynamics for explaining commonly observed positive relationships between biodiversity and asynchrony and community stability. Our results should not be interpreted to mean that compensatory dynamics are not important for community stability – they are (Figs. 3c and 5c, and Supplementary Table 1). But compensatory effects apparently do not necessarily play a substantial role in producing positive relationships between diversity and stability, at least in our grassland systems, because a more diverse grassland community does not show dynamics which are compensatory to a substantially greater extent than a less diverse community. Though grassland systems have been the most common and important model systems so far for investigating relationships between diversity and stability, whether other ecosystem types (e.g., forest16, meadow27, and plankton29 systems) show results similar to ours remains an important unanswered question.

One possible reason that statistical averaging played a strong role in mediating diversity-stability relationships is the relatively small spatial scale of our study plots. In such small plots, species dynamics are significantly influenced by demographic stochasticity, due to their low abundance, which leads to independent fluctuations among species. Indeed, de Mazancourt et al.30 illustrated that demographic stochasticity, rather than environmental stochasticity, was the major process explaining diversity-stability relationships across four long-term biodiversity experiments, including the two experiments in our study. Therefore, our results were consistent with de Mazancourt et al.30 At larger scales, it is possible that CPE plays a more important role in mediating diversity-stability relationships, as the effect of demographic stochasticity should decrease while that of environmental stochasticity should increase. Testing this hypothesis would require large-scale community data that are surveyed over time and with replicates.

Our analyses show that compensatory dynamics are an important contributor to community stability, but not necessarily an important mediator of diversity-stability relationships. Compensatory dynamics can arise from differential responses of species to environmental fluctuations30,31 and/or species interactions32,33. In areas with stronger environmental fluctuations, we may find stronger CPE and possibly a larger contribution of CPE to diversity-stability relationships. Hallett et al.10 showed, using the plant survey dataset we have also used here, that precipitation variability enhanced compensatory dynamics in grassland communities. It is also possible, a priori, that strong environmental fluctuations could reduce CPE and promote synchronous dynamics if species-specific responses to the environment were positively correlated31. In this later case, if a higher species richness were to contribute to weakening the synchronizing effects of environmental fluctuations, CPE could then provide an important mediator for diversity-stability relationships. Our study detected considerable compensatory dynamics, due to both environmental fluctuations and species interactions (Supplementary Figs. 67). But compensatory dynamics were not related to diversity in our study systems, so CPE played no major role in mediating diversity-stability relationships.

The terms “insurance effect”, “statistical averaging effect”, and “portfolio effect” are widely used in explaining the stabilizing effects of biodiversity11,12,18,19,20,21. All these terms relate to the fact that aggregate ecosystem properties vary less in more diverse communities. Though these terms have, at times, been used interchangeably, their meanings differ, and our theory separates them explicitly. The insurance effect emphasizes differential responses of diverse species to environmental variations or species competitive interactions, fundamentally biological mechanisms12,30. In contrast, the “statistical averaging effect” was initially used to describe the stabilizing effect of independent fluctuations, a fundamentally statistical phenomenon also exhibited in stock portfolios and diverse other non-biological contexts; it corresponds to our SAE20. An alternative definition of “portfolio effect” (i.e., SAE × CPEenv in our secondary decomposition) allows for non-zero correlations among species, and accounts for both statistical effects and joint responses of distinct species to environmental perturbations12,19,21 (Methods and Supplementary Fig. 5). Our theory provides a flexible framework to quantitatively distinguish these different terms. Our conclusion held, that statistical averaging effects were the principal mechanism behind positive diversity-stability relationships in our data, regardless of the definitions used (Figs. 2 and 4, and Supplementary Figs. 6 and 7).

Many studies have focussed on the positive relationship between species richness and asynchrony7,15,16,17,24,25,26,27, and some have highlighted the importance of evenness of abundance9,28,30,34; our theory helps illuminate the role of another kind of evenness in stability. It has been reported that unevenness can alter the way in which population variability and portfolio effects change with species richness9. Species evenness can also enhance the positive relationship between complementarity effects and species asynchrony28. Distinct from evenness of average abundances among species considered in previous studies, our theory involves evenness of temporal variability among species (see Eq. (4) in Methods), which substantially influences SAE, together with species richness. Based on our theory, for a given species richness, a higher evenness of variability will lead to a higher SAE, thus increasing community stability. This highlights the importance of the evenness of variability for further consideration in future studies.

Our theoretical framework may be useful for a wide variety of studies which examine the influence of external factors on the relationship between diversity and stability. Our framework involves population stability, asynchrony, compensatory dynamics, and statistical-averaging, helping unify these ideas. Our measure of compensatory effects is actually a transformation of the classic variance ratio22,23 (see Methods section for details), which has been commonly used. Studies reporting altered diversity-stability relationships under altered externally imposed conditions can use our theory to ascertain details of the mechanisms by which their observed effects operate. For example, Hautier et al.24,25 found that fertilization weakened the positive association between diversity and stability in grasslands, due to a reduction in strength of the positive richness-asynchrony relationship. Our theory, applied to their data, should make it possible to determine if fertilization weakens the relationship between statistical averaging and diversity, possibly by altering evenness; or if it weakens the relationship between compensatory dynamics and diversity, possibly by promoting population growth of different species simultaneously. Further partitioning of effects is also possible using our secondary decomposition of CPE.

We note that while we have decomposed the stabilizing effects of biodiversity into multiple terms representing different processes, this does not mean that these terms are necessarily independent of each other. Instead, they may often be related, as all of them are driven by shared ecological processes in realistic communities. For instance, interspecific competition affects the patterns of species diversity (both the number and evenness of species), compensatory dynamics across species, and population variability35,36. To this end, our decomposition framework provide approaches to tease apart different pathways by which a single cause generates an effect. Moreover, our framework integrates multiple concepts that have been commonly used in the literature but often interpreted in different ways, helping clarify how these ideas are linked, quantitatively.

The diversity-stability relationship has long been a central question in ecology, and its underlying mechanisms are still much debated7,12. Our results have revealed that statistical mechanisms, rather than biological ones, appear to be of predominant importance for the relationship between biodiversity and ecological stability, at least for the data we examined. We are not suggesting that ecologists should ignore factors related to compensatory dynamics (e.g., niche differences) in attempting to understand community stability, because these factors indeed represent a key component of community stability and may contribute to diversity-stability relationships in broader contexts, e.g., at larger spatial scales. Instead, we have observed that, for the systems we examined, diversity was not strongly or consistently related to compensatory mechanisms in the same way that it was strongly and consistently associated with statistical averaging effects. Our theory provides a flexible framework for future research to quantify different mechanisms and understand their possible context dependency.

Methods

Empirical data

We applied our theory to two datasets (Table 1): the plant survey dataset and the biodiversity-manipulated experiment dataset. The plant survey dataset contains nine sites of long-term grassland experiments across the United States (see also Hallett et al.10, and Zhao et al.23). Five of nine sites are from the Long Term Ecological Research (LTER) network (see Table 1). Plant abundances were measured either as biomass or as percent cover. In percent-cover cases, summed values can exceed 100% due to vertically overlapping canopies. All sites were sampled annually and were spatially replicated. We only used data of the plant survey dataset from unmanipulated control plots. Methods for data collection were constant over time.

The biodiversity-manipulated experimental dataset comprises two long-term grassland experiments, BigBio and BioCON, at the Cedar Creek Ecosystem Science Reserve. Both experiments directly manipulated plant species number (1, 2, 4, 8, 16 for BigBio; and 1, 4, 9, 16 for BioCON). BioCON also contains different treatment levels for nitrogen and atmospheric CO2, but here only data from the ambient CO2 and ambient N treatments were used. We excluded plots with only one species. BigBio comprises 125 plots over 17 years, and BioCON comprises 59 plots over 22 years (Table 1).

Theory

Let xi(t) denote the biomass of species i = 1, …, S at time t = 1, …, t and let μi = mean (xi (t)), σi = \({{\mbox{sd}}}\)(xi (t)), and \({v}_{i}={\sigma }_{i}^{2}\) be the mean, standard deviation and variance of species i, computed through time. Let vij = cov \(({x}_{i}\left(t\right),\, {x}_{j}\left(t\right))\) be the covariance, through time, of the dynamics of species i and j. Let xtot \(\left(t\right)={\sum }_{i}{x}_{i}(t)\), \({\mu }_{{{\mbox{tot}}}}={\sum }_{i}{\mu }_{i}\), \({v}_{{{\mbox{tot}}}}={\sum }_{i,j}{v}_{{ij}}\), and \({{{{{{\rm{\sigma }}}}}}}_{{{{{{\rm{tot}}}}}}}=\sqrt{{v}_{{{{{{\rm{tot}}}}}}}}\). When population time series are uncorrelated, \({v}_{{{{{{\rm{tot}}}}}}}={\sum }_{i}{v}_{i}\).

As defined previously10,15, community stability is the inverse coefficient of variation of \({x}_{{{\mbox{tot}}}}\left(t\right)\), \({S}_{{{{{{\rm{com}}}}}}}={\mu }_{{{{{{\rm{tot}}}}}}}/{\sigma }_{{{{{{\rm{tot}}}}}}}\). Population stability is the inverse of weighted-average population variability9, \({\sum }_{i}\frac{{\mu }_{i}}{{\mu }_{{{{{{\rm{tot}}}}}}}}{{CV}}_{i}={\sum }_{i}\frac{{\mu }_{i}}{{\mu }_{{{{{{\rm{tot}}}}}}}}\frac{{\sigma }_{i}}{{\mu }_{i}}={\sum }_{i}\frac{{\sigma }_{i}}{{\mu }_{{{{{{\rm{tot}}}}}}}}\), i.e, \({S}_{{pop}}={\mu }_{{{{{{\rm{tot}}}}}}}/{\sum }_{i}{\sigma }_{i}\). The ratio of community stability over population stability is the Loreau-de Mazancourt asynchrony index14, Φ = \({\sum }_{i}{\sigma }_{i}/{\sigma }_{{{{{{\rm{tot}}}}}}}\), so that

$${S}_{{{{{{\rm{com}}}}}}}=\varPhi {S}_{{{{{{\rm{pop}}}}}}}.$$
(1)

Now we suppose a hypothetical community with the same species-level variances and means as the original community but with species covariances equal to zero. Then, (1) becomes Scom_ip = (SAE)Spop, where \({S}_{{{{{{\rm{com}}}}}}\_{{{{{\rm{ip}}}}}}}=\frac{{\mu }_{{{{{{\rm{tot}}}}}}}}{\sqrt{{\sum }_{i}{v}_{i}}}=\frac{{\mu }_{{{{{{\rm{tot}}}}}}}}{\sqrt{{\sum }_{i}{\sigma }_{i}^{2}}}\) is the value of community stability in the case of uncorrelated or independent populations and SAE is the component of Φ due to statistical averaging (here, “ip” stands for “independent populations”). The equation Scom_ip = (SAE)Spop can be interpreted as a definition of SAE. We then have

$$SAE=\frac{{S}_{{{{{{\rm{com}}}}}}\_{{{{{\rm{ip}}}}}}}}{{S}_{{{{{{\rm{pop}}}}}}}}=\frac{{\sum }_{i}{\sigma }_{i}}{\sqrt{{\sum }_{i}{\sigma }_{i}^{2}}}.$$
(2)

The compensatory effect is then the rest of Φ, i.e.,

$$CPE=\frac{{S}_{{{{{{\rm{com}}}}}}}}{{S}_{{{{{{\rm{pop}}}}}}}\times SAE}=\frac{{\sum }_{i}{\sigma }_{i}}{{\sigma }_{{{{{{\rm{tot}}}}}}}\left({\sum }_{i}{\sigma }_{i}/\sqrt{{\sum }_{i}{\sigma }_{i}^{2}}\right)}=\frac{\sqrt{{\sum }_{i}{\sigma }_{i}^{2}}}{{\sigma }_{{{{{{\rm{tot}}}}}}}}.$$
(3)

Considering the classic variance ratio \({{{{{\rm{\varphi }}}}}}=\frac{{V}_{{{{{{\rm{tot}}}}}}}}{{\sum }_{i}{V}_{i}}=\frac{{\sigma }_{{{{{{\rm{tot}}}}}}}^{2}}{{\sum }_{i}{\sigma }_{i}^{2}}\), our CPE is \(1/\sqrt{\varphi }\). Values CPE > 1 (respectively, <1) correspond to greater (resp., lesser) community stability than would be expected if dynamics of different taxa were independent, reflecting compensatory (resp., synchronous) dynamics. We also have

$$SAE=\frac{{\sum }_{i}{\sigma }_{i}}{\sqrt{{\sum }_{i}{\sigma }_{i}^{2}}}=\sqrt{\frac{1}{{\sum }_{i}{\sigma }_{i}^{2}/{({\sum }_{i}{\sigma }_{i})}^{2}}}=\sqrt{\frac{1}{{\sum }_{i}{({\sigma }_{i}/{\sum }_{i}{\sigma }_{i})}^{2}}}=\sqrt{\frac{1}{{\sum }_{i}{({p}_{i})}^{2}}}.$$
(4)

where \({p}_{i}={\sigma }_{i}/{\sum }_{i}{\sigma }_{i}\).

In the Introduction and Results, we characterized SAE as relating to statistical mechanisms, but Eq. (4) shows that the strength of SAE depends on the evenness of species variances, which may be influenced by species biology. In fact, \({SAE}=\frac{{S}_{{{{{{\rm{com}}}}}}\_{{{{{\rm{ip}}}}}}}}{{S}_{{{{{{\rm{pop}}}}}}}}\) is a comparison between the two values that community stability would take in the scenarios of independent populations (\({S}_{{{{{{\rm{com}}}}}}\_{{{{{\rm{ip}}}}}}}\)) and entirely synchronous populations (\({S}_{{{{{{\rm{pop}}}}}}};\) see elsewhere14 for a proof that \({S}_{{{{{{\rm{pop}}}}}}}\) is the value community stability would take if populations were perfectly synchronous), and so may be best characterized as a statistical effect, the strength of which depends on evenness of variances (and therefore on biology). We define \({{SAE}}_{{{{{{\rm{even}}}}}}}\) to be the value SAE would take in the case of perfect evenness of species variances, i.e., if all species variances were identical (that means σ1 = σ2 = … = σ). We can then define the evenness effect, \({EVN}=\frac{{SAE}}{{{SAE}}_{{{{{{\rm{even}}}}}}}}\), so that the equation \({SAE}={EVN}\times {{SAE}}_{{{{{{\rm{even}}}}}}}\) separates out biological/evenness effects from purely statistical effects. \({{SAE}}_{{{{{{\rm{even}}}}}}}\) is a purely statistical version of statistical averaging because it only captures the stabilizing effects of averaging independent random variables, being uninfluenced by evenness. It can straightforwardly be shown that \({{SAE}}_{{{{{{\rm{even}}}}}}}=\sqrt{S}\): applying Eq. (4) to the scenario of equal population variances, one sees that \({{SAE}}_{{{{{{\rm{even}}}}}}}=\sqrt{\frac{1}{{{\sum }_{i}\left(1/S\right)}^{2}}}=\sqrt{S}\). This is the maximum possible value of SAE for a given species richness, S.

It is possible to explicitly quantify the effects of the evenness of variability. Using the formula \({{\log }}\left({S}_{{{{{{\rm{com}}}}}}}\right)={{\log }}\left({SAE}\right)+{{\log }}\left({CPE}\right)+{{\log }}({S}_{{{{{{\rm{pop}}}}}}}),\) the main observation of our study has been that regression slopes of \({{\log }}\left({SAE}\right)\) against \({{\log }}\left(S\right)\) tend to have substantially positive slopes, whereas regression slopes of \({{\log }}\left({CPE}\right)\) and \({{\log }}({S}_{{{{{{\rm{pop}}}}}}})\) against \({{\log }}\left(S\right)\) tend to have negative or only slightly positive slopes; and hence regression slopes of \({{\log }}\left({S}_{{com}}\right)\), which are sums of the other slopes, tend to be positive primarily because of the positive relationship between log(SAE) and log(S). But, in another decomposition, we can also write \({{\log }}\left({S}_{{com}}\right)={{\log }}\left({{SAE}}_{{{{{{\rm{even}}}}}}}\right)+{{\log }}\left({ENV}\right)+{{\log }}\left({CPE}\right)+{{\log }}({S}_{{{{{{\rm{pop}}}}}}})=\frac{1}{2}{{\log }}\left(S\right)+{{\log }}\left({ENV}\right)+{{\log }}\left({CPE}\right)+{{\log }}({S}_{{{{{{\rm{pop}}}}}}})\). We can observe that, because all our regressions of \({{\log }}\left({SAE}\right)\) against \({{\log }}\left(S\right)\) had slope less than 1/2 (Figs. 2e and 4e), regressions of \({{\log }}\left({EVN}\right)\) versus \({{\log }}\left(S\right)\) will have negative slope for our empirical systems. Therefore \({{\log }}\left({S}_{{com}}\right)\) tends to depend on \({{\log }}\left(S\right)\) with a “baseline” slope of 1/2, for purely statistical reasons (the \({{\log }}\left({{SAE}}_{{{{{{\rm{even}}}}}}}\right)\) effect), with effects of evenness (\({{\log }}\left({ENV}\right)\)), compensatory dynamics (log(CPE)) and population variability (log(Spop)) tending to reduce this slope. This again supports the conclusion that statistical averaging is the main reason for positive diversity-stability relationships in our data, now using a definition of statistical averaging that is purely statistical. We used SAE instead of \({{SAE}}_{{{{{{\rm{even}}}}}}}\) in Results to represent the concept of statistical averaging because it is a quantification of ideas which were previously present in the literature20, although it can be viewed instead as a combination of statistical averaging effects and effects of evenness of species variances.

Note that Loreau and de Mazancourt14 got synchrony as 1/S for the special case of identical \({\sigma }_{i}\) and zero-correlation, a value which seems to contrast with our result, \(\sqrt{S}\), described above. But Loreau and de Mazancourt14 measured community-wide synchrony via a statistic \(\theta=\frac{{\sigma }_{T}^{2}}{{\left({\sum }_{i}{\sigma }_{i}\right)}^{2}}\). We can make further transformation: \(\theta=\frac{{({\sigma }_{T}/{\mu }_{{tot}})}^{2}}{{\left({\sum }_{i}{\sigma }_{i}/{\mu }_{{tot}}\right)}^{2}}=\frac{{{CV}}_{{com}}^{2}}{{\left({\sum }_{i}\frac{{\mu }_{i}}{{\mu }_{{tot}}}\bullet \frac{{\sigma }_{i}}{{\mu }_{i}}\right)}^{2}}=\frac{{{CV}}_{{com}}^{2}}{{{CV}}_{{pop}}^{2}}\). Here CVpop2 means the square of the weighted average of CVi. That is, θ measures a ratio of community-level CV2 to population level CV2. But in our system, our asynchrony measures a ratio of community-level stability (1/CV) to population-level stability. These differences in notational and terminological choices explain why we got \(\sqrt{S}\) but Loreau and de Mazancourt14 got 1/S in this special case – our results are actually consistent with those of Loreau and de Mazancourt when notational choices are accounted for.

Further decomposition of CPE

In previous sections, we decomposed asynchrony into a statistical averaging effect (SAE) and a compensatory effect (CPE) via constructing a surrogate or hypothetical community stability value Scom_ip by quantifying what community stability would be if all species were to fluctuate independently and thus species covariances equal zero. By comparing the stability of the real community, Scom, to the hypothetical community stability under the assumption of species independence, Scom_ip, we then computed CPE as Scom/Scom_ip. But compensatory dynamics among species in a community can arise from at least two distinct mechanisms: (1) differential response of species to environmental perturbations, and (2) direct or indirect interactions among species19. Correspondingly, we can decompose CPE into two parts: compensatory effects due to differential responses to environmental perturbations (CPEenv) and compensatory effects due to species interactions (CPEint). We here initiate that decomposition.

To separate CPEenv from CPEint, we construct another surrogate/hypothetical community stability value, called \({S}_{{{{{{\rm{com}}}}}}\_{{{{{\rm{sur}}}}}}}\), for which the effects on community stability of components of species covariances due to species interactions are eliminated, keeping only components due to common species responses to environmental perturbations. In the following section “Surrogate community stability from different plots”, we establish surrogate community stability values for the systems of the plant survey dataset by means of time series from other plots from the same system. Time series from distinct plots may covary, but if they do, it is likely because of common environmental influences rather than species interactions. In the section “Surrogate community stability from monocultures”, we establish surrogate community stability values for the systems of the biodiversity-manipulated experimental dataset by means of monocultures which were established alongside the multi-species plots. Monocultures in separate plots may covary, but if they do, it is likely again because of common environmental influences rather than species interactions. Both approaches lead to approximations of the value community stability would take if species interactions were eliminated, and therefore \({S}_{{{{{{\rm{com}}}}}}\_{{{{{\rm{sur}}}}}}}={{{CPE}}_{{{{{{\rm{env}}}}}}}\times {SAE}\times S}_{{{{{{\rm{pop}}}}}}}={{{CPE}}_{{{{{{\rm{env}}}}}}}\times S}_{{{com}}\_{{{{\rm{ip}}}}}}\). Thus, we calculate CPEenv by

$${{CPE}}_{{{{{{\rm{env}}}}}}}=\frac{{S}_{{{{{{\rm{com}}}}}}\_{{{{{\rm{sur}}}}}}}}{{S}_{{{{{{\rm{com}}}}}}\_{{{{{\rm{ip}}}}}}}}.$$
(5)

The compensatory effect from species interactions is then the rest of CPE, i.e.

$${{CPE}}_{{{{{{\rm{int}}}}}}}=\frac{{CPE}}{{{CPE}}_{{env}}}=\frac{{S}_{{com}}/{S}_{{{com}}\_{{ip}}}}{{S}_{{com}\_{sur}}/{S}_{{com}\_{ip}}}=\frac{{S}_{{{{{{\rm{com}}}}}}}}{{S}_{{{{{{\rm{com}}}}}}\_{{{{{\rm{sur}}}}}}}}.$$
(6)

Both CPEenv and CPEint can be either greater than or less than 1, corresponding to the fact that joint species responses to environmental perturbations (CPEenv) and species interactions (CPEint) can be either stabilizing or destabilizing. Thus, we have decomposed community stability, Scom, into four parts (Supplementary Fig. 5): population stability, Spop; the statistical averaging effect, SAE; compensatory effects due to joint species responses to environmental perturbations, CPEenv; and compensatory effects due to species interactions, CPEint.

In the Introduction and Results, the term “portfolio effect” was used for the stabilizing effect of biodiversity from independent fluctuations (zero correlation) of species abundances through time20, measured by SAE. However, other studies have adopted an alternative definition of portfolio effects, allowing for non-zero correlations between species induced by common responses to the environment, but excluding components of correlations resulting from species interactions12,19,21. In our framework, this alternative definition of portfolio effects could be represented by SAE × CPEenv (Supplementary Fig. 5). We prefer to group CPEenv together with CPEint rather than with SAE, because SAE corresponds to primarily statistical mechanisms, whereas CPEenv involves species responses to the environment, which we regard as containing biological information. But other interpretations and classifications can certainly be reasonable, as demonstrated by earlier studies which defined portfolio effects in a way that corresponds to our product SAE × CPEenv12,19,21. In the following sections, we decompose diversity-stability relationships into components that come from the relationship of each of the four terms of Supplementary Fig. 5 to diversity.

Surrogate community stability from different plots

In this section, we explain how we construct surrogate communities that apply to observational data without monoculture data, such as our plant survey dataset. In doing so, we calculate an approximate hypothetical/surrogate community stability index, Scom_sur, using populations from different mixture plots. The general idea is to construct a surrogate covariance matrix,

$${{{{{\rm{C}}}}}}=\left(\begin{array}{ccc}{V}_{11} & \cdots & {C}_{1S}\\ \vdots & \ddots & \vdots \\ {C}_{S1} & \cdots & {V}_{{SS}}\end{array}\right),$$

which will be used to calculate Scom_sur. Again using xi(t) to denote the biomass of species i = 1, …, S at time t = 1, …, t in a focal plot, the ith diagonal element of the surrogate covariance matrix, Vii, is the variance of xi(t). The off-diagonal element Cij equals the covariance of xi and Zj, where \({Z}_{j}\left(t\right)=\frac{{z}_{j}\left(t\right)-{\bar{z}}_{j}}{{{{{{\rm{sd}}}}}}\left({z}_{j}\right)}\times {{{{{\rm{sd}}}}}}\left({x}_{j}\right)+{\bar{x}}_{j}\) is a surrogate time series, with zj representing a time series of species j taken from another plot. When more than one other plot contained species j, we randomly chose one. The time series \({Z}_{j}\left(t\right)\) was constructed to have the same mean and variance as xj(t), but its correlations with xj(t) reflects correlations between two non-interacting populations of species i and j from distinct plots. We then calculated \({S}_{{{{{{\rm{com}}}}}}\_{{{{{\rm{sur}}}}}}}=\frac{{\bar{X}}_{{{{{{\rm{tot}}}}}}}}{\sqrt{\mathop{\sum}\limits_{{ij}}{C}_{{ij}}}}\), and we calculated CPEenv and CPEint from Eqs. (5) and (6). This method was applied only to the plant survey dataset, where plots at a site within the plant survey dataset were considered replicates. In the biodiversity-manipulated experimental dataset, different plots of the same diversity had different artificially maintained species composition.

Surrogate community stability from monocultures

In this section, we explain how we construct surrogate communities that apply to a biodiversity experiment with monoculture data. Given a community consisting of species i = 1, …, S, recall that xi(t) denotes the biomass of species i = 1, …, S at time t = 1, …, t. Suppose monocultures, yi(t), were maintained for each species over the same time period. When more than one monoculture was maintained for a species, we randomly selected one. The hypothetical/surrogate community stability value \({S}_{{{{{{\rm{com}}}}}}\_{{{{{\rm{sur}}}}}}}\) was computed as \({S}_{{{{{{\rm{com}}}}}}\_{{{{{\rm{sur}}}}}}}=\frac{{\bar{Y}}_{{{{{{\rm{tot}}}}}}}}{{{{{{\rm{sd}}}}}}\left({Y}_{{{{{{\rm{tot}}}}}}}\right)}\), where \({Y}_{{{{{\rm{tot}}}}}}\left(t\right)={\sum }_{i}{Y}_{i}(t)\) and \({Y}_{i}\left(t\right)=\frac{{y}_{i}\left(t\right)-{\bar{y}}_{i}}{{{{{{\rm{sd}}}}}}\left({y}_{i}\right)}\times {{{{{\rm{sd}}}}}}\left({x}_{i}\right)+{\bar{x}}_{i}\). The time series \({Y}_{i}\left(t\right)\) were constructed to have the same mean and variance as the time series xi(t), but with correlations equal to those between the corresponding monocultures. CPEenv and CPEint were then calculated from Eqs. (5) and (6). We repeated this process 100 times, randomly selecting from among available monocultures for each species on each repeat calculation, and taking means to get CPEenv and CPEint. This method was only used for the biodiversity-manipulated experimental dataset because monocultures were not available for the plant survey dataset.

It is worth noting that our construction of the surrogate community assumes that in the absence of species interactions, species in the mixture should exhibit the same correlation as those in monocultures. While this assumption may hold if population dynamics were solely influenced by environmental stochasticity, the influence of demographic stochasticity may lead to a lower correlation in the mixture than in monocultures due to the relatively lower population size in the mixture. In other words, our surrogate community might overestimate the correlation between species and thus underestimate \({S}_{{{{{{\rm{com}}}}}}\_{{{{{\rm{sur}}}}}}}\) (i.e., the expected stability of a community without interactions). Moreover, the possible underestimation of \({S}_{{{{{{\rm{com}}}}}}\_{{{{{\rm{sur}}}}}}}\) could be more pronounced for more diverse communities (which have substantially lower population sizes in mixtures than monocultures), thus possibly creating an artificially negative correlation between species richness and CPEenv (\(={S}_{{{{{{\rm{com}}}}}}\_{{{{{\rm{sur}}}}}}}/{S}_{{{{{{\rm{com}}}}}}\_{{{{{\rm{ip}}}}}}}\)), as well as a positive correlation between species richness and CPEint (\(={S}_{{{{{{\rm{com}}}}}}}/{S}_{{com}\_{sur}}\)). So, the patterns in Supplementary Fig. 7a, b might be partially explained by such artificial effects. However, how to separate out such artificial effects from other processes was by no means obvious30. We note, importantly, that such effects, even if they exist, should not affect our main conclusion. Indeed, the positive correlation between species richness and SAE × CPEenv (Supplementary Fig. 7d) would be even stronger if such effects existed and were accounted for.

Statistical analysis

For the plant survey dataset, the values of each of our theoretical quantities were averaged across all plots for each site and then relationships between site averages were assessed with regression. For the biodiversity-manipulated experimental dataset, theoretical quantities were calculated for individual plots because species richness was manipulated at the plot level. All theoretical quantities were log10 transformed prior to generating plots and preforming regressions, except for the Shannon index, because the Shannon index has a log transformation already embedded in its definition. All analyses were programmed in R 4.0.537.

To compute the confidence interval of CPE, we constructed bootstrapped species time series. For each plot, separately, the AAFT procedure38, implemented in the surrog function in the R package wsyn, was used to generate bootstrapped species time series for the plot, for which time series were rendered uncorrelated while retaining the autocorrelation and marginal-distribution properties of the original data. Such a bootstrapped dataset instantiates the null hypothesis that species were unrelated while retaining other statistical properties of the data not related to species relationships. For each plot, 1000 bootstrapped datasets were computed, giving rise to 1000 bootstrapped quantities Scom_ip(i) for i = 1, …, 1000. We then computed the quantities SAE(i) = Scom_ip(i)/Spop and CPE(i) = Scom/(SAE(i)Spop). Confidence intervals for CPE were computed using quantiles of the distribution CPE(i).

Reporting summary

Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.