The Greek mathematician Archimedes first noted that any object immersed or partly immersed in a fluid (i.e., a liquid or a gas) is buoyed upward by a force equal to the weight of the fluid displaced by the object. The crucial factor in determining an object's buoyancy is its density, the relationship between its weight, which is pulling it down, and its volume. If an object placed in water weighs more than an equal volume of water -- in other words, if the density of the object is greater than the density of water -- then the downward force of gravity will be greater than the upward buoyant force, and the object will sink. On the other hand, if the object weighs less than the fluid it would displace if submerged, it will sink only to the point where it displaces the amount of fluid equal to its weight. At that point, the upward force of the fluid equals the downward force of gravity, and the object floats.
When a block of wood is placed in water, it sinks until it displaces the amount of water with a weight equal to its own. At this point, the upward force on the block from the surrounding water is equal to the downward force of gravity. Because the wood block is less dense than water -- that is, taking up more space for the same weight -- it remains partially out of the water and floats. A block of steel, by contrast, sinks to the bottom of the water. Steel, made mostly of iron atoms, has a much greater density than water or wood, primarily because iron atoms are much heavier than the hydrogen, oxygen, and carbon atoms of the water and wood.
So, how can huge ships, which are made mostly of steel, float? By changing the shape of the steel into a hollow drum or bowl, a ship's effective density is altered. The density of a hollow ship is calculated by dividing the gross weight of the ship -- the combined weight of the steel, any cargo on board, and the air contained in the vessel -- by their combined volume. As a hollow object begins to sink down into the surface of the water, it displaces a much larger volume of water than it would if it were solid. Since the hollow ship acts like any other object with a large volume for its weight, provided its overall density is less than that of water, it will float.