Density is the mass per unit volume. If we say that liquid A has higher density than liquid B then B will float on top of A if liquid A and B does not mix with each other. In this case we know that oil will not mix with water. Since oil has lesser density it will float on water. When there is a fire due to oil if we put water to minimize the fire propagation. But what happens is water go down and oil will come to the top due to the density issue. So the fire caused by oil can easily propagate since now it has water as a carrying media. So it is advised not to throw water at a fire caused by oil. We should use something like `CO_2` spray to stop these fires.