The Zhangxuan Basin serves as an ecological barrier and water conservation area for Beijing, the capital of China. Clarifying the hydrochemical evolution of groundwater in this region is essential for the effective management of groundwater resources and the protection of ecological security. In this study, based on data regarding chemistry and level of shallow groundwater from 2016 to 2022, hydrogeochemical analysis methods and geostatistical techniques were applied to investigate the hydrochemical evolution and genesis mechanisms of groundwater under the influence of human activities. The results showed that: (1) From 2016 to 2022, the groundwater remained predominantly characterized by Ca2+ and HCO3-, with the primary hydrochemical type unchanged as HCO3-Ca·Mg. (2) From 2016 to 2022, an overall decreasing trend in hydrochemical components was observed, alongside an increase in HCO3-Na type groundwater. Spatially, along the direction of groundwater flow, a general trend of increasing hydrochemical components was noted, with a significant rise in HCO3-Na type groundwater. (3) The spatiotemporal distribution and evolution of hydrochemistry were influenced by water-rock interactions, lithological characteristics, groundwater flow patterns, and human activities. Along the groundwater flow direction, lithological particles became finer, enhancing forward cation exchange and leaching, with the dissolution of silicate and carbonate minerals intensifying. In localized areas, the hydrochemical components were influenced by the extraction of groundwater source areas and the discharge of industrial waste.