Soap molecules have two parts: a hydrophilic (water-loving) “head” and a hydrophobic (water-hating) “tail.” When soap is added to water, molecules disperse with heads pointing outward and tails inward, forming micelles.
When oil is added, the hydrophobic tails are attracted to oil molecules while the hydrophilic heads remain in water. This surrounds oil droplets with soap molecules, preventing them from coalescing into larger droplets. This is how soap helps remove oil from surfaces.
Soap molecules can also break down bonds between oil molecules and surfaces such as skin or fabric, making soap effective at removing grease and dirt.