The frequency of climate extremes will change in response to shifts in both mean climate and climate variability. These individual contributions, and thus the fundamental mechanisms behind changes in climate extremes, remain largely unknown. Here we apply the probability ratio concept in large-ensemble climate simulations to attribute changes in extreme events to either changes in mean climate or climate variability. We show that increased occurrence of monthly high-temperature events is governed by a warming mean climate. In contrast, future changes in monthly heavy-precipitation events depend to a considerable degree on trends in climate variability. Spatial variations are substantial however, highlighting the relevance of regional processes. The contributions of mean and variability to the probability ratio are largely independent of event threshold, magnitude of warming and climate model. Hence projections of temperature extremes are more robust than those of precipitation extremes, since the mean climate is better understood than climate variability.