The primary mechanisms include hydrophobicity and oleophobicity. Hydrophobic nanoparticles make the fabric repel water-based stains, while oleophobic nanoparticles repel oil-based stains. This is often achieved through a process called self-cleaning, where liquid forms beads on the surface and rolls off, taking dirt and stains with it.