To curb soil erosion, the Grain-for-Green Project has been implemented in the Loess Plateau region, and there have been few quantitative evaluations of the impact of ecological engineering on the spatial distribution of soil erosion on the Loess Plateau. In this paper, we used ArcGIS software, the Revised Universal Soil Loss Equation (RUSLE) model and the Geographic Detector (GeoDetector) model to investigate the changes in the spatial distribution of soil erosion and driving forces before and after the implementation of the Grain-for-Green Project in Yanhe River Basin, a typical area on the Loess Plateau. After the implementation of the Grain-for-Green Project, the soil erosion showed a decreasing trend over time and from local improvement to global optimization in space. The implementation of the Grain-for-Green Project led to changes in the dominant driving force of the spatial distribution of soil erosion, with the dominant driving force changing from the slope factor to the vegetation coverage factor. The main driving force of the two-factor interaction on soil erosion spatial differentiation changed from the slope factor and other factors to the vegetation coverage and other factors. The Grain-for-Green Project mainly influenced soil erosion by increasing the vegetation cover. The effect of the Grain-for-Green Project on the spatial distribution of soil erosion had hysteresis and spatial differences, and the direct and indirect driving forces generated by ecological engineering reached more than 50% on average.