As global climate change intensifies, Net Ecosystem Productivity (NEP) serves as a crucial indicator for measuring the carbon absorption and release of ecosystems, playing a vital role in understanding the carbon cycle and shaping climate policy. The Northwestern region of China, characterized as a typical inland arid and semi-arid area, is particularly sensitive to global changes. Understanding the environmental drivers of NEP in this region is critical for both regional ecological protection and global environmental management. This study utilized environmental data from five provinces in Northwestern China, applying the Random Forest (RF) model and SHapley Additive exPlanation (SHAP) method to analyze the primary environmental factors influencing NEP. The research integrated climatic data (including temperature, precipitation, wind speed, and solar radiation), soil characteristics such as pH, organic carbon content, and soil texture, topographic attributes elevation and slope, and a Human Footprint. The RF model identified significant environmental factors impacting NEP, and SHAP values were used to explain the specific contributions of these factors. Furthermore, multiple linear regression analysis revealed interactions among environmental factors. The results indicate that solar radiation (Srad), precipitation, topsoil reference bulk density (T_REF_BULK), temperature, and the topsoil clay fraction (T_CLAY) significantly influence NEP. Notably, interactions between aspect and T_CLAY, aspect and T_REF_BULK, as well as the human footprint (HFP) and Srad, also show significant impacts on NEP. This study confirms that solar radiation, precipitation, soil characteristics, and human activities are the primary environmental drivers of NEP in the Northwest region of China, with solar radiation playing the most critical promotional role. The findings not only provide a scientific basis for the management of ecosystems in Northwestern China but also offer references for formulating global climate change mitigation strategies and estimating the global carbon budget. Future research should further explore the specific mechanisms and interactions of these drivers across different ecosystems to more comprehensively understand and predict the trends in NEP changes.