The bilge of a ship or boat is the part of the hull that would rest on the ground if the vessel were unsupported by water. The "turn of the bilge" is the transition from the bottom of a hull to the sides of a hull.
Bilge compartment in a steel hulled ship (looking down)
Bilge compartment and pump
A compartment is a portion of the space within a ship defined vertically between decks and horizontally between bulkheads. It is analogous to a room within a building, and may provide watertight subdivision of the ship's hull important in retaining buoyancy if the hull is damaged. Subdivision of a ship's hull into watertight compartments is called compartmentation.
Transverse bulkheads appear horizontally in this photo of the battleship USS South Dakota (BB-57) under construction.
These compartments are formed by non-structural bulkheads.
A watertight hatch with the door dogs clearly visible