Soap is basically long-chain fatty acids of sodium and potassium salts.
One end will be solar where the sodium attached to and the alkyl end will be non-polar. so a soap molecular has 2 parts one is hydrophobic and another one is hydrophilic part
when we add soap to dirty water, the hydrophobic part will get attached to the dirt molecule whereas the hydrophilic part will move away from the dirt molecule
thus forms a micelle. so we can able to say that the polar group dissolves in water and non-polar group dissolves in the dirt particle. these micelles formed will be negatively charged and a stable emulsion is formed
hence we can say that the cleansing action of soap is due to emulsification and micelle formation