The shallow groundwater of the quaternary system in the Baoshan basin, Yunnan Province is seriously polluted, threatening human health and restricting local socio-economic development; therefore, it is necessary to investigate the hydrochemical characteristics and formation mechanisms of the shallow groundwater of the quaternary system in the Baoshan basin. This study used EVS 2022 to establish a 3D visual geological model of the quaternary system in the basin and divided the shallow groundwater aquifers of the quaternary system into three groundwater systems, sampling 22, 9, and 4 groups in each groundwater system, respectively. Mathematical statistics, Piper’s trilinear diagram, Gibbs plots, the Gaillardet model, the ion ratio method, groundwater saturation, and the PCA-APCS-MLR model were used to analyze the groundwater hydrochemical characteristics and genesis of the study area. The results show the following: (1) The types of groundwater chemicals are mainly HCO3-Ca-Mg type and HCO3-Ca, the causes of the water chemical characteristics are mainly influenced by water–rock interaction and alternate cation adsorption, and the rock types with which the groundwater exchanges substances are carbonate rocks and silicate rocks. (2) The Fe2+, Mn2+, and NH3-N contents in groundwater systems I and II exceed the standard, which is the human activity area, and groundwater pollution is mainly affected by human activities. (3) Four main categories of factors were obtained according to the PCA-APCS-MLR model, namely dissolution filtration, migration and enrichment factors, geological and human activity factors, and environmental factors and pollution factors; the cumulative contribution of variance was 77.84%, and the groundwater chemical characteristics were jointly influenced by hydrogeological conditions and human activities. The results of this study provide a basis for groundwater protection and management in the Baoshan basin, where groundwater system I is the key area for pollution and should be strengthened for control.