If oil is mixed with water, the mixture will eventually separate into two separate layers with oil on top and water below. The best explanation of why oil forms the top layer and water forms the bottom layer is:
Oil is less dense than water
Water is less dense than oil
Gravity pulls the water down but has no effect on oil
It was pure chance that oil formed the top layer
📝 Batafsil tushuntirish
Oil is less dense than water, so it floats on top.