Year-to-year changes in carbon uptake by terrestrial ecosystems have an essential role in determining atmospheric carbon dioxide concentrations1. It remains uncertain to what extent temperature and water availability can explain these variations at the global scale2-5. Here we use factorial climate model simulations6 and show that variability in soil moisture drives 90 per cent of the inter-annual variability in global land carbon uptake, mainly through its impact on photosynthesis. We find that most of this ecosystem response occurs indirectly as soil moisture-atmosphere feedback amplifies temperature and humidity anomalies and enhances the direct effects of soil water stress. The strength of this feedback mechanism explains why coupled climate models indicate that soil moisture has a dominant role4, which is not readily apparent from land surface model simulations and observational analyses2,5. These findings highlight the need to account for feedback between soil and atmospheric dryness when estimating the response of the carbon cycle to climatic change globally5,7, as well as when conducting field-scale investigations of the response of the ecosystem to droughts8,9. Our results show that most of the global variability in modelled land carbon uptake is driven by temperature and vapour pressure deficit effects that are controlled by soil moisture.