Strictly speaking, it is the pH of water that is in chemical equilibrium with the soil mass (pH is a measure of concentration of aqueous H+ ion). Generally speaking, the pH varies as a function of soil composition, which itself tends to also broadly equate with the nutrient storage capacities of soils. Mineral species (such as quartz) which do not provide a decent source of acid-neutralizing components ("anions") tend to be a major component of acidic soils, whereas soluble salts of the conjugate bases of weak acids (things like carbonate minerals) are good buffers of pH and lead to higher dissolved component contents in the aqueous phase, and several such salts (nitrates, phosphates, sulfates) are themselves sources of nutrient requirements. There is also, of course, the clay fraction that absorbs loads of nutrients and clays also are relatively alkalic and will react to eliminate acidity where excessive (clays will release hydroxide (OH-) ions when broken down to basic iron and aluminum oxides). Sandy soils also tend to have pH dominated by organic acids that derive from the breakdown and decay of dead vegetative debris.
Some soils are made of such coarse particulates that they provide little buffering capacity to the naturally acidic precipitation despite being composed of rock fragments containing salts of conjugate bases of acids (potential acid neutralizers), primarily because of surface area and reaction rate limitations.
Plants, as with many animals, have variable tolerance of low nutrient supplies and/or acidic conditions, so the soil pH tends to govern what plant life can thrive in a particular soil. If, like me, you live in an area with very sandy soil, the choice of plants and need of fertilization or soil amendment can be important if you want your flowers or veggies to thrive.