The stabilization of nanoparticles by ionic surfactants occurs via electrostatic repulsion. The charged head groups of the surfactants adsorb onto the surface of nanoparticles, providing a charged barrier that prevents agglomeration. This electrostatic stabilization is particularly effective in aqueous environments, where the charged groups can interact with water molecules.