Cations play an important role in the formation of clay, especially the case of calcium-magnesium-sodium (Ca-Mg-Na) which under reducing conditions such as soil swamp, together with ferrous iron (Fe+2) lead to formcación smectite clays under alkaline pH. Soils with low content of basic cations and ferric iron (Fe+3) and acid pH, produce clays of the kaolinite group.
the answer depends a lot on what clay (mineral). For example, the formation of kaolinite is typical in natural environments where the base cations are leached out of the system. Whereas in systems where they may accumulate the formation of smectites would be favoured.