The resistance of soil to changes in pH and available cations from the addition of acid or basic material is a measure of the buffering capacity of a soil and increases as the CEC increases. Hence, pure sand has almost no buffering ability, while soils high in colloids have high buffering capacity. Buffering occurs by cation exchange and neutralisation.
The addition of highly basic aqueous ammonia to a soil will cause the ammonium to displace hydrogen ions from the colloids, and the end product is water and colloidally fixed ammonium, but no permanent change overall in soil pH.
The addition of lime, CaCO3, will displace hydrogen ions from the soil colloids, causing the fixation of calcium and the evolution of CO2 and water, with no permanent change in soil pH.
The addition of carbonic acid (the solution of CO2 in water) will displace calcium from colloids, as hydrogen ions are fixed to the colloids, evolving water and slightly alkaline (temporary increase in pH) highly soluble calcium bicarbonate, which will then precipitate as lime (CaCO3) and water at a lower level in the soil profile, with the result of no permanent change in soil pH.
All of the above are examples of the buffering of soil pH. The general principal is that an increase in a particular cation in the soil water solution will cause that cation to be fixed to colloids (buffered) and a decrease in solution of that cation will cause it to be withdrawn from the colloid and moved into solution (buffered). The degree of buffering is limited by the CEC of the soil; the greater the CEC, the greater the buffering capacity of the soil.