Soap acts as an emulsifier and ensures that water and oil mix well together.