The surfaces of most clay minerals and of organic matter are negatively charged and sorb cations to compensate their charge. The reaction among cations sorbed on solid surfaces and dissolved in water is termed cation exchange. The cation exchange capacity (CEC) depends on clay and organic matter content. The CEC may be about 50 - 100 mmol / (L pore water) in a sandy aquifer.
The concentration of a sorbed, exchangeable cation is a function of the various solute ions which compete for
the exchanger sites. The competition follows reactions such as:
Na+ + K-X
↔ Na-X + K+
Na+ + ½ Ca-X2
↔ Na-X + ½ Ca2+
etc. X indicates the exchange site with a charge of -1.
The total solute concentrations also affect the equilibria, as indicated by the law of mass action:

Note in the graph that the exchangeable fractions of the divalent ions ([Mg-X2] and [Ca-X2]) indeed increase with dilution, although the ratio of the divalent and monovalent ions remains the same in solution (the ratio [Ca2+] / [Na+] is constant). The pattern was observed in laboratory experiments by Van der Molen and in the Flevo-polder in The Netherlands, cf. figs. 2 and 3 in Appelo, 1996; (0.91 Mb pdf).