The reasons why oil floats on water are because these water and oil have different densities and polarities. Oil and water do not mix or are immiscible because oil is less dense than water and will float on it.
In physics, the definition of density is that the mass of a material is divided by its volume. If one uses equal volumes of oil and water in an experiment comparing their densities, then the densities of oil and water will be different because water and oil have different masses.
The second reason for oil floating on top of water has to due with the polarities of these substances. Water is polar and oil is non-polar, and there will be no attraction between their molecules. This accounts for the formation of separate layers of oil and water and their immiscibility.