Things float because they are less dense in water, which is why you can lift quite a heavy person in a swimming pool. This loss of weight is called buoyancy.
Buoyancy is created by the upward push, or upthrust, of the water.
When an object is immersed in water, its weight pushes it down. At the same time the water pushes it back up with a force equal to the weight of water displaced (pushed out of the way). This is called Archimedes’ principle (see Archimedes).
An object sinks until its weight is exactly equal to the upthrust of the water, at which point it floats.
Things that are less dense than water float; those that are more dense sink.
Steel ships float because although steel is denser than water, their hulls are full of air. They sink until enough water is displaced to match the weight of steel and air in the hull.
Oil floats on water because it is less dense.
Ships float at different heights according to how heavily laden they are and how dense the water is.
Ships float higher in sea water than in fresh water because salt makes the sea water more dense.
Ships float higher in dense cold seas than in warm tropical ones. They float higher in the winter months.