Water scarcity assessments are crucial for sustainable water management in the future. Previously, such assessments were mainly conducted through simple statistical analyses and water resource models, which apply minimal observational data on socioeconomic factors. Here, we present a data-driven method to evaluate water scarcity, and reveal the interplaying mechanisms between its key driving factors. We selected Beijing as a case study for its complex human–water system representative of other megacities. We collected annual parameters from government’s statistics and yearbooks during 2000–2021 and designed a system dynamics (SD) framework to characterize the key human–water coupling components. The framework was then used to project water demand and supply changes under different shared socioeconomic pathways (SSPs) (2024–2050) using meteorological forcing from CMIP6. Results show that the SD framework performs reasonably in reproducing historical water supply and demand variability, showing continuously mitigated water scarcity severity due to government efforts to constrain agricultural and industrial water demand. Future projections indicate that water scarcity severity will be gradually mitigated until 2030, particularly under SSP1, SSP2, and SSP3 scenarios. After 2030, water scarcity is intensified across all scenarios except for SSP5. This is associated with increased (decreased) sectoral water demand, together with reduced (increased) total water supply under each scenario. Sensitivity analyses, by keeping key parameters constant, highlight the distinct roles of climatological and socioeconomic factors in shaping the timing and variability of water scarcity, and offer valuable policy implications. The SD framework in this study has unique strength in simulating the temporal evolutions of sectoral water demands and their complex interactions, and thus can improve the realism of water demand estimation, which is essential for water resource modeling and assessment studies.