China has increased its vegetation coverage and enhanced its terrestrial carbon sink through ecological restoration since the end of the 20th century. However, the temporal variation in vegetation carbon sequestration remains unclear, and the relative effects of climate change and ecological restoration efforts are under debate. By integrating remote sensing and machine learning with a modelling approach, we explored the biological and physical pathways by which both climate change and human activities (e.g., ecological restoration, cropland expansion, and urbanization) have altered Chinese terrestrial ecosystem structures and functions, including vegetation cover, surface heat fluxes, water flux, and vegetation carbon sequestration (defined by gross and net primary production, GPP and NPP). Our study indicated that during 2001–2018, GPP in China increased significantly at a rate of 49.1–53.1 TgC/yr2, and the climatic and anthropogenic contributions to GPP gains were comparable (48%–56% and 44%–52%, respectively). Spatially, afforestation was the dominant mechanism behind forest cover expansions in the farming‐pastoral ecotone in northern China, on the Loess Plateau and in the southwest karst region, whereas climate change promoted vegetation cover in most parts of southeastern China. At the same time, the increasing trend in NPP (22.4–24.9 TgC/yr2) during 2001–2018 was highly attributed to human activities (71%–81%), particularly in southern, eastern, and northeastern China. Both GPP and NPP showed accelerated increases after 2010 because the anthropogenic NPP gains during 2001–2010 were generally offset by the climate‐induced NPP losses in southern China. However, after 2010, the climatic influence reversed, thus highlighting the vegetation carbon sequestration that occurs with ecological restoration.