Study region: Beijing-Tianjin-Hebei Region, China Study focus: Understanding factors driving water demand is crucial for water resource planning and management. However, traditional models fail to capture the complex nonlinear factors that drive real-world water demand. While machine learning models can capture nonlinear re-lationships, comprehending the complex mechanisms underpinning the models is difficult. Therefore, we combined machine learning with explainable artificial intelligence to analyze the factors driving water demand in the study region. New hydrological insights for the region: A water demand forecasting framework is proposed for analyzing the factors driving water demand. Results show that the main driving factors differ across city types. Population is the most crucial factor influencing water demand, with an effect size of 50.30%, 39.72%, and 31.79% in service-based, industrial, and agricultural cities, respectively. The second-and third-most important factors in service-based cities are the added value of secondary industry (AVSI) and irrigated area (IA), respectively. In industrial and agri-cultural cities, the second-and third-most-important factors are AVSI and temperature and temperature and IA, respectively. By quantifying the nonlinear relationships between water de-mand and driving factors, we identify the critical points associated with changes in correlation structure, such as urbanization rate (70%) and per capita disposable income (25,000 CNY per annum). Thus, this study can serve as a valuable reference for developing accurate models to forecast water demand.