The ability of a ship to float depends on its overall density compared to the density of water. The average density of a ship, including its hull, cargo, and other components, must be less than the density of water for it to float. Ships are designed with hollow chambers and compartments to increase their overall volume and reduce their average density, allowing them to displace more water and experience greater buoyant force.
While a ship floats on water, it can sink if its density increases beyond that of water. This can occur due to various factors, such as taking on too much water through damage or flooding, overloading the ship with cargo, or changes in the ship's internal structure or design. When the average density of the ship becomes greater than the density of water, the buoyant force is no longer sufficient to support its weight, causing the ship to sink.