Given global climate change and the projected increases in the greenhouse effect, enhancing the carbon storage capacity of forest ecosystems is especially critical. To fully realize the potential carbon sequestration, it is imperative to understand the drivers affecting carbon storage in forest ecosystems, particularly with disturbances that disrupt existing balance. In this study, we explored the effects of stem-only harvest at various thinning intensities on forest structure and carbon density in middle-aged natural secondary forests, located in the northern temperate zone. Carbon density included aboveground carbon density (ACD), soil organic carbon stocks (SOCD), and total carbon density (TCD), which was the sum of ACD and SOCD. We employed the random forest analysis method to identify significant variables influencing changes in carbon density. Structural equation modelling (SEM) was then used to determine the drivers of changes in forest carbon density. The results showed that moderate thinning (20 %–35 % trees removed), is an effective management practice for increasing the TCD in forests. Although heavy thinning (35.1 %–59.9 % trees removed) accelerated individual growth, it did not fully offset the carbon removed due to thinning. It is noteworthy that light thinning (0–19.9 % trees removed) not only reduced the species richness but also caused a significant number of tree deaths. Large live trees were an important direct determining factor of ACD, but not the only one. In addition, thinning indirectly influenced ACD by reducing canopy density and deformed tree density. The increase in dead tree density had an adverse impact on SOCD, and this phenomenon increased with the passage of recovery time. Conversely, greater thinning intensity enhanced SOCD. Moreover, TCD was directly influenced by tree height, large live trees, and stand density. Furthermore, thinning altered the conifer ratio, thereby influencing tree growth and indirectly controlling the TCD. We believe that this knowledge will be highly beneficial for successful forest management and enhancing the carbon sequestration capacity of forest ecosystems.