Density determines if an item sinks or floats. Items with a density greater than that of water (1 gram per cubic centimeter) sink in water, while those with a density less than water float.
Density is defined as mass divided by volume. Items such as lead are very dense, while air is less dense.
When considering density, one may ask why ships made of steel float. While the steel is denser than water, the density of the entire ship including the air inside, is less than water, so it floats. If the ship leaks, water fills the space once occupied by air, making the object more dense, so the ship sinks.