Why do some objects float while others sink in water?
This is because of the difference in their density. The objects float if they are less dense than water and sink if they are more dense.
For example, oil floats on water because it is lighter (less dense) than water.