Difference between soap and detergent
The difference between a soap and detergent is basically in its chemical composition. Soaps are composed of sodium or potassium salts of long chain carboxylic acids whereas detergents are composed of salts of  long chain sulphates and sulphonates. This means that soaps and detergents are composed of a long hydrocarbon chain with one end having a polar head that is negatively charged. The polar head is hydrophilic or water loving and lyophobic or oil hating while the tail of the hydrocarbon chain is hydrophobic or water hating and lyophilic or oil loving.

The cleaning action of both the detergent and soap is similar. Dirt on clothes and skin have a oily layer and this oil is non-polar and  insoluble in water. Therefore simple rinsing of such clothes wont remove the dirt, as oil  is immiscible in water. However the use of soap or detergent helps in the removal of these dirt. When soap or detergent is used for washing, the non-polar tail of the hydrocarbon, breaks up the non-polar oil molecules. This results in the formation of micelles(an aggregate of surfactant molecules dispersed in a liquid colloid), with the non-polar oil molecules at the center and the polar hydrophilic (water-attracting) groups on the outside which shields the oil molecules from the water, thus making it soluble. In this manner the oil particles are suspended in water. The soap or detergent thus effectively prevents the oil from coalescing and returning to the cloth. Now, rinsing of clothes easily removes the dirt.

On account of their difference in chemical composition, they have different degree of sensitiveness to soft and hard water. Hard water contains excess of magnesium and calcium, which causes the soap to precipitate out as calcium or magnesium salts, know as hard water scum. While in the case of detergents, due to its different chemical composition, they are less prone to the effect of hard water.

References


[1] http://en.wikipedia.org/wiki/Soap
[
2] http://en.wikipedia.org/wiki/Detergent
[3] http://www.hindu.com/seta/2006/04/13/stories/2006041302191700.htm
[4] http://www.preservearticles.com/2011100814968/what-is-the-difference-between-soaps-and-detergents.html
[
5] http://chemistry.about.com/od/cleanerchemistry/a/how-soap-cleans.htm
[6] http://www.edinformatics.com/interactive_molecules/soap.htm