Soap acts as a surfactant, reducing the surface tension of water and facilitating the emulsification of oils and greases, allowing them to be removed during washing.