Why does water repel foam from a soap?

Soap molecules are opposing. While one end tends to stick to water, the opposite end repels it. Suds are caused by this action. Soap molecules surround water molecules, and the parts of the molecules that repel the water point in a direction away from the water.