The Loess Plateau is renowned for its fragile ecosystem, and understanding the changes and driving impacts of ecosystem health (EH) is crucial for formulating environmental protection policies for the region. Soil erosion, as a key limiting factor of the region's ecosystem, must be considered when evaluating EH in this area. Based on this idea, a new framework for assessing EH is proposed. The efficient machine learning model (light gradient boosting machine model) and the variable explanation model (SHapley Additive exPlanation model) are combined to quantify the functional relationships between various driving factors and EH, thereby exploring the impacts of climatic factors, socioeconomic development (SED), and ecological restoration projects (ERP) on EH. The study found that: (1) From 1995 to 2020, EH in the Loess Plateau increased from 0.42 to 0.58, and the forms of spatial clustering changed. Moreover, there are significant differences in the speed and patterns of EH improvement in different regions, especially after 2010. (2) The importance of precipitation (PRE), SED, ERP, and temperature (TEM) is 33 %, 26 %, 24 %, and 17 %, respectively. The driving impacts exhibit non-monotonic polynomial relationships of third, fourth, second, and fourth degrees, indicating that the mechanisms through which EH is influenced by these factors can change. (3) Counties with higher response to PRE (>0.32) are mainly located in the central region. Counties with higher response to SED (>0.30) are primarily in areas with higher population and urbanization. Counties with higher response to ERP (>0.36) are mainly in the eastern region. Counties with higher response to TEM (>0.26) are primarily in the southern and western regions. The results of this paper provide new insights for EH research in areas with fragile ecosystems and are of significant importance for the ecological civilization construction of the Loess Plateau.