Water and oil do not interact due to differences in polarity. Water is a polar molecule, whereas oil is not. Water's polarity gives it a high surface tension. The difference in polarity also makes oil insoluble in water. Soaps can take advantage of these differences in order to separate the two kinds of molecules, thereby facilitating the cleaning process.
A polar molecule has its electrostatic potential distributed unevenly throughout the molecule. The resulting difference in electric potential is called a dipole moment . A water molecule consists of two hydrogen atoms bonded to an oxygen atom. The oxygen atom exerts a strong attractive force on the electrons in the molecule. The water molecule has a bent shape, where the negative charge is concentrated around the oxygen atom and a net positive charge is concentrated around the hydrogen atoms. This gives water a net dipole moment. Oil molecules, on the other hand, are not polar . There is no net charge in any location of the oil molecule.
Water's polarity gives it the ability to form hydrogen bonds with other molecules. In a hydrogen bond, the negative oxygen dipole attracts the positive hydrogen dipole from another water molecule. The resulting bonds are called hydrogen bonds, and they contribute to the high surface tension of water. In order to change the surface tension, you can heat the water. This lower surface tension allows water to get into smaller spaces than if it had a higher surface tension.
The relative polarity of two molecules directly relates to their solubility. In general, solutions involve molecules of similar polarity. Therefore, oil is insoluble in water. In fact, oil is said to be hydrophobic, or "water-hating." The net charges of a water molecule do not attract the neutral oil molecules, and vice versa. Hence, oil and water do not mix. If you combine the two, you will notice that they create separate layers in a cup.
Soaps take advantage of the molecular differences between water and oil. Part of a soap molecule is nonpolar, and therefore can mix with oil. Another part of a soap molecule is polar, and therefore can interact with water molecules. This interaction helps weaken the surface tension and hydrogen bonding between water molecules. In addition, the nonpolar ends of the soap molecules will be attracted to the nonpolar oil and grease molecules. This creates a spherical structure called a micelle, where the oil or grease molecules are at the center, and the water is kept outside.