The Yellow River Basin (YRB) plays a pivotal role in the water resources management of its region, significantly influenced by the interplay between climate change and human activities, particularly in its upper and middle reaches (UMRYR). This study aims to elucidate the evolving patterns and determinants of runoff within the UMRYR, a matter of considerable importance for the basin’s water resource management, strategy, and distribution. Utilizing the Google Earth Engine (GEE) platform, this research accessed comprehensive datasets including precipitation, drought index, and terrace area, among others, to examine their effects on runoff variations at five gauge stations across the YRB. Terrace data was extracted from Landsat imagery via the Random Forest Model, while annual runoff figures from 1990 to 2020 were sourced from the Sediment Bulletin of China River. Employing the Mann-Kendall test, we assessed the temporal changes in runoff over three decades. In addition, runoff drivers were analyzed by stepwise regression and redundancy analysis, leading to the construction of a multiple linear regression model. The accuracy of predicting annual runoff using the multiple linear model was verified through cross-validation and comparison with the ARIMA time series model. Our findings reveal the efficacy of the random forest algorithm in classifying terraces, achieving an accuracy rate exceeding 0.8. The period from 1990 to 2020 saw a general increase in annual runoff across the five gauging stations in the UMRYR, albeit with variations in the pattern, particularly at the Tangnaihai gauge station which presented the most complex changes. Crucially, three main drivers—summer precipitation (SP), terrace area (TR), and drought index (DI)—were identified as significant predictors in the regression models. The multiple linear regression model outperformed the ARIMA model in forecasting accuracy, underlining the significance of integrating these drivers into runoff prediction models for the UMRYR.