Terrestrial ecosystems remove about 30 per cent of the carbon dioxide (CO2) emitted by human activities each year1, yet the persistence of this carbon sink depends partly on how plant biomass and soil organic carbon (SOC) stocks respond to future increases in atmospheric CO2 (refs. 2,3). Although plant biomass often increases in elevated CO2 (eCO2) experiments4–6, SOC has been observed to increase, remain unchanged or even decline7. The mechanisms that drive this variation across experiments remain poorly understood, creating uncertainty in climate projections8,9. Here we synthesized data from 108 eCO2 experiments and found that the effect of eCO2 on SOC stocks is best explained by a negative relationship with plant biomass: when plant biomass is strongly stimulated by eCO2, SOC storage declines; conversely, when biomass is weakly stimulated, SOC storage increases. This trade-off appears to be related to plant nutrient acquisition, in which plants increase their biomass by mining the soil for nutrients, which decreases SOC storage. We found that, overall, SOC stocks increase with eCO2 in grasslands (8 textpm 2 per cent) but not in forests (0 textpm 2 per cent), even though plant biomass in grasslands increase less (9 textpm 3 per cent) than in forests (23 textpm 2 per cent). Ecosystem models do not reproduce this trade-off, which implies that projections of SOC may need to be revised.