Water is an ionic compound and oil is non-ionic compound. Water is made up of one oxygen atom and two hydrogen atoms. Oil is made up of a long chain of carbon atoms, attached with hydrogen atoms. The molecular structures of water and oil are very different from each other.
The physical property called surface tension of water, as well as that of oil, is high. So oil molecules and water molecules cling to their respective molecules, and tend not to combine with one another. Even when water and oil are mixed, oil gets separated as droplets, and floats on the water. This is due to the less dense nature of oil than water, and the higher surface tension of water.
The other scientific reason why oil and water do not mix is their chemical nature. A water molecule is Polar, and oil is non-Polar in nature. In a water molecule, oxygen atoms are negatively charged and the hydrogen atom is positively charged. Hence, the water molecule is dipolar. An electric dipole has a positively charged end and a negatively charged end. The dipole moment or strength of the dipole is determined by the difference between the magnitudes of the two charges, and the distance between them. So oil and water have different dipole strengths. A molecule possessing high dipole moment has the ability to dissociate in ionic conditions.
For example, in a salt solution, Na+ will be attracted towards the oxygen atoms of water, while Cl- will be attracted towards the hydrogen atoms. Hence, salt tends to be soluble in water. It is proven that ionic compounds, or charged molecules, will be easily soluble in water, but oil is non-ionic, and an uncharged molecule, and therefore cannot dissociate like NaCl and be attracted to the polar ends of the water molecules. Hence, oil is insoluble in water.
It is worth mentioning here about the hydrophilic and hydrophobic nature of molecules. Water liking, ionic or charged molecules are called hydrophilic. Water hating, non-ionic and uncharged molecules are called hydrophobic. Oil is hydrophobic in nature. In the presence of oil, water molecules try not to lose their intra molecular hydrogen bonding, form strong bonds with the other water molecules, and therefore move away from the oil. So oil is called ‘water hating’.
Due to the above reasons, oil does not mix with water.