<!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}-->
The hydrophobic part of the soap gets attached to the dirt while the hydrophilic part remains in contact with water. Plenty of soap molecules come together to form micelles and trap the dirt at the center. Upon agitation, the trapped dirt is carried away by water, leaving behind the clean cloth.