The past two decades have seen great progress in understanding the mechanisms of ecosystem stability in local ecological systems. There is, however, an urgent need to extend existing knowledge to larger spatial scales to match the scale of management and conservation. Here, we develop a general theoretical framework to study the stability and variability of ecosystems at multiple scales. Analogously to the partitioning of biodiversity, we propose the concepts of alpha, beta and gamma variability. Gamma variability at regional (metacommunity) scale can be partitioned into local alpha variability and spatial beta variability, either multiplicatively or additively. On average, variability decreases from local to regional scales, which creates a negative variability–area relationship. Our partitioning framework suggests that mechanisms of regional ecosystem stability can be understood by investigating the influence of ecological factors on alpha and beta variability. Diversity can provide insurance effects at the various levels of variability, thus generating alpha, beta and gamma diversity–stability relationships. As a consequence, the loss of biodiversity and habitat impairs ecosystem stability at the regional scale. Overall, our framework enables a synthetic understanding of ecosystem stability at multiple scales and has practical implications for landscape management.