Soaps are sodium or potassium fatty acids salts, produced from the hydrolysis of fats in a chemical reaction called saponification.
Soap cleans by acting as an emulsifier. Basically, soap allows oil and water to mix so that oily grime can be removed during rinsing.
Each soap molecule has a long hydrocarbon chain, sometimes called its ‘tail’, with a carboxylate ‘head’.
Its hydrophilic (water-loving) carboxylate group (-CO2) interacts with water molecules via ion-dipole interactions and hydrogen bonding. The hydrophobic (water-fearing) part of a soap molecule, its long, non polar hydrocarbon chain, does not interact with water molecules. The hydrocarbon chains are attracted to each other by dispersion forces and cluster together, forming structures called micelles. In these micelles, the carboxylate groups form a negatively-charged spherical surface, with the hydrocarbon chains inside the sphere. Because they are negatively charged, soap micelles repel each other and remain dispersed in water.
Grease and oil are non polar and insoluble in water. When soap and soiling oils are mixed, the non polar hydrocarbon portion of the micelles break up the non polar oil molecules. A different type of micelle then forms, with non polar soiling molecules in the center. Thus, grease and oil and the ‘dirt’ attached to them are caught inside the micelle and can be rinsed away.