Soaps are sodium or potassium salts of higher fatty acids (containing 15 – 18 carbon atoms) such as stearic acid and palmitic acid. The process of formation of soap is known as saponification. The process of saponification can be shown as

(Here R may be – C15H31,- C17H33 or – C17H35)
Soaps and detergents consist of a large hydrocarbon tail with negatively charged head. The hydrocarbon tail is hydrophobic (water repelling) and the negatively charged head is hydrophilic (water-attracting).
The dirt in the cloth is due to the presence of dust particles in fat or grease which stick to the cloth. When soap or detergent is dissolved in water the molecules gather together as clusters called micelles when the dirty cloth is dipped in soap or detergent solution. The soap and dirt particles come in contact with each other.
The non-polar tails of the soap begin to dissolve in non – polar oil or grease. While the polar head part remains in the water. As more and more soap particles enter the grease each fat or oil particle is surrounded by a number of negatively charged ends. Since the similar charges repel each other the oil or grease droplets break off into small globules of oil. These are still surrounded by the negatively charged polar heads of the soap molecules.
This prevents the small globules from coming together to form bigger particles. The rubbing by hands or mechanical stirring also helps to break the grease particles. In this manner, the grease particles can be completely broken up and it forms an emulsion of grease or oil contained in dirt and the droplets are washed away with water.
