Groundwater conditions are crucial for understanding the evolution of soil salinization. The installation of subsurface pipes significantly alters both the distribution of water and salt in the soil and the groundwater depth; these dynamics and their interrelationships warrant further investigation. To clarify the relationship between groundwater dynamics and changes in water and salt in soil under subsurface pipe salt drainage conditions in the Yinchuan region of Ningxia, groundwater observation wells and soil sample monitoring points were established in Pingluo County. A combined approach of in situ monitoring and laboratory testing was employed to analyze changes in groundwater depth and salinity and their effects on water and salt in soil. The findings revealed that changes in groundwater depth and salinity exhibited clear seasonal patterns. The groundwater depth was deepest at 1.97 m in October and shallowest at 1.62 m in July. The salinity was highest at 22.28 g/L in April and lowest at 18.24 g/L in August. In summer, the groundwater was shallower and had lower salinity, while in other seasons, it was deeper with higher salinity. Soil salinity was lowest in July at 4.58 g/kg and highest in April at over 5.5 g/kg. It decreased with increasing groundwater depth, demonstrating a linear relationship. Additionally, soil salinity and groundwater salinity exhibited synchronous fluctuations, exhibiting an exponential relationship. Based on these observations, a model was developed to describe the relationship among groundwater salinity, groundwater depth, and soil salinity under subsurface pipe salt drainage conditions in the Yinbei region of Ningxia. This model was validated against measured data, yielding a correlation coefficient R2 of 0.7238. These findings provide a reference for analyzing the relationship between soil salinity and groundwater in similar regions.