The reason oil and water do not mix is that water is a polar molecule, while oil is non-polar. A molecule's polarity is determined by the structure of its atoms. The electric charge of a polar molecule is unbalanced, causing it to be positive on one side, and negative on the other.
Alice Ball developed a method for extracting the useful, water soluble (which means it can be dissolved in water) parts of oil molecules. She did this by using special alcohols to strip away the non-polar parts of the oil molecules.
Using this Molecule Polarity simulator from University of Colorado Boulder, you can explore how the atomic structure of a molecule determines the strength and direction of its polarity.