Ballast tanks are specialized compartments found in ships, submarines, and other watercraft that are used to control the vessel's buoyancy and stability. These tanks can be filled with water or air to adjust the overall weight and distribution of the craft, allowing it to submerge, surface, or maintain a specific level in the water.