The chemistry of stain removers, cleaners, and detergents is a rather long story. Without going into too much detail, most cleaning agents use these strategies:
Soap is a surfactant; so are the sulfonates listed in the ingredients for many spot removers and carpet cleaners. A surfactant molecule contains long hydrocarbon tail with a small polar head. The hydrocarbon tail of the soap molecules surround (dissolve) grease, while the polar ends dissolve in water; the net result is that the grease/soap complex is water soluble and gets washed away. This process is called 'emulsification'. You can see it working if you add soap to some oil-and-vinegar salad dressing. The vinegar layer of the dressing gets cloudy because the soap has surrounded little droplets of oil and prevents them from rejoining the oil layer.
Sulfonates are more often used than soap these days. They work better in 'hard' water, which causes soap molecules to precipitate from solution (forming bathtub rings and 'soap scum').
Some cleaning agents contain enzymes that speed up reactions that digest proteins or fats in stains.
Author: Fred Senese email@example.com
Copyright © 1997-2010 by Fred Senese
Comments & questions to firstname.lastname@example.org
Last Revised 02/23/18.URL: http://antoine.frostburg.edu/chem/senese/101/consumer/faq/print-stain-removers.shtml