Diversity-stability relationships in grasslands depend on the environment. Climate change and soil degradation potentially alter soil pH and community stability within grassland environments, although it remains unclear how soil acidity and alkalinity affect diversity-stability relationships. We conducted a three-year experiment of acidification and alkalization treatments in an arid grassland in northern China, and found that increasing and decreasing soil pH reduced community species richness, community diversity, community and dominant species asynchrony, and biomass stability. Soil acidification reduced community stability by reducing dominant species stability. Soil alkalization reduced community stability by reducing species asynchrony and dominant species stability. Acidification significantly enhanced the availabilities of soil NO3—N, P, and K, but did not affect the concentrations of soil total C, N, and P. By contrast, alkalization significantly reduced soil total C and N, but did not affect the availabilities of soil N, P, and K. Structural equation model analysis revealed that altered soil pH affected soil nutrients associated with species asynchrony and community stability, which indicated the importance of soil nutrients in driving community stability. Our results suggest that soil pH–mediated community stability is mainly driven by dominant species stability rather than diversity. This study provides novel insights indicating that arid grassland stability would be weakened under changing soil pH, subsequently leading to land degradation and reducing long‐term productivity and sustainability.