Ordinary water does not remove dirt from clothes or skin because the dirt present is oily or greasy in nature. Soaps are one of the most commonly used cleansing agents and are capable of reacting with water to remove dirt. Each soap molecule has a polar head group (carboxylate ion, COO- group) and a long non-polar hydrocarbon tail (R group from long chain fatty acid). The polar head attracts the polar water molecule and is called hydrophilic end and the non-polar tail attracts the water insoluble oily or greasy dirt particles. When a dirty cloth is placed in soap solution, the long non-polar hydrocarbon tail of soap molecules points towards the oily dirt particles and the polar heads point towards the water. This forms a spherical structure with polar parts of the molecule on the surface and non-polar parts in the center. This spherical structure is called micelle. This micelle is attracted towards water and carries the oily dirt particles along with it. This causes the dirt particles to detach from the fibres of the cloth. In this manner, clothes become free from dirt or dust. Although soap is a good cleaning agent, its cleaning capacity is reduced when used in hard water. The cleaning action of soap is very effective in soft water.
This video explains how to study the comparative cleaning capacity of a sample of soap in soft and hard water.