What are the differences between an ordinary soap and detergent in composition and action?

Soaps are sodium or potassium salts of long chain carboxylic acids (fatty acids) whereas detergents are salts of long chain sulphates or sulphonates. Hence, soaps and detergents have a long organic tail with a (negatively charged) polar head, that is, they are anionic in nature. The organic tail is hydrophobic (water-hating) but lyophilic (oil-loving) whereas the polar head is hydrophilic (water-loving) and lyophobic (oil-hating).The cleansing action of both detergents and soaps is about the same.

Dirty clothes and skin have oily layers. Simple wetting and rinsing of such clothes and skin would not remove the dirt because the oil is immiscible in water. When a detergent or soap is used along with water, the lyophilic tails of the detergent species tag on to the oily layer while the hydrophilic heads face the water. The agitation causes the oily matter to break into small droplets and is trapped inside the lyophilic `cage' formed by the detergent molecules. Thus the oily matter is kept suspended in water. The structure formed by the detergent molecules where the oil is trapped is called a micelle. The role of the detergent molecules is to prevent the oil droplets from coalescing once again and returning to the cloth. The differences between soaps and detergents stem from their sensitivities to hard water and acidic conditions. When hard water (which contains magnesium and calcium ions in more than permitted levels) is used, the soap precipitates out as calcium or magnesium salts. On the other hand, the detergents are less prone to complexation with the metal ion and hence would be less affected by the hard water. Likewise, the soap would precipitate out under acid conditions as the carboxylic acid group would be protonated, while the detergent would survive acidic conditions better.

Source: thehindu.com