Water is not very efficient at getting things wet because water molecules join together and produce surface tension. This enables insects such as pond skaters to ‘walk’ on water. When detergent is added to a drop of water, the ball-shaped drop collapses because surface tension is reduced.
Detergents remove grease from fabric because the tails of the detergent molecules attach themselves to the grease particles. The heads of the molecules are attracted to water, so the grease particle is pulled away from the cloth as the washing is agitated. Mild electrical charges from the detergent prevent the grease particles from joining.
Cotton fabric before washing has grease ‘articles trapped among the fibres. During the wash, detergent molecules lift out the grease and leave the fabric clean.