You may have experienced examples of how oil and water don't mix. Oil and vinegar salad dressing separate. Motor oil floats on top of the water in a puddle or in an oil spill. No matter how much you mix oil and water, they always separate. Chemicals that don't mix are said to be immiscible. The reason this happens is because of the chemical nature of oil and water molecules.
Like Dissolves Like
The saying in chemistry is that "like dissolves like." What this means is the polar liquids (like water) dissolve in other polar liquids, while nonpolar liquids (usually organic molecules) mix well with each other. Each H2O or water molecule is polar because it has a bent shape in which the negatively charged oxygen atom and the positively charged hydrogen atoms are on separate sides of the molecule. Water forms hydrogen bonds between oxygen and hydrogen atoms of different water molecules. When water encounters nonpolar oil molecules, it sticks to itself rather than mingles with the organic molecules.
Making Oil and Water Mix
Chemistry has tricks for getting oil and water to interact. For example, detergent works by acting as emulsifiers and surfactants. The surfactants improve how well water can interact with a surface, while the emulsifiers help oil and water droplets mix together.
Density and Immiscibility
Oil floats on water because it is less dense or has lower specific gravity. The immiscibility of oil and water, however, is not related to the difference in density.