Cation-exchange capacity (CEC) is the soil's ability to hold positively charged ions and nutrients. Soils with higher clay or organic matter content have a greater CEC, allowing them to retain more nutrients and protect groundwater. The soil's pH also affects its CEC and nutrient availability. Higher pH increases CEC while acidic soils contain ions like hydrogen and aluminum that reduce CEC and nutrient uptake by plants.