By building up the salt concentration in the blood around a new chamber, an osmotic gradient is built up that draws water from the chamber into the blood, and gases from the blood diffuse into the emptying chamber. This process results in the overall density of the cephalopod decreasing. With enough of the shell divided into chambers and emptied, the cephalopod can reduce its density until it is the same as that of sea water. This condition is called neutral buoyancy. In primitive cephalopods like the pearly nautilus, this shell is external and superficially like that of a gastropod snail.
More advanced cephalopods have internal shells.
The cuttlefish is a cephalopod with an internal shell. While still providing buoyancy, it is no longer protective. These more active cephalopods rely on camouflage or speed to evade predators. The most advanced cephalopods, such as the squids and octopuses do not have chambered shells at all. In squid the shell is a simple, often feather-like, strut while in the octopus it is reduced to small plates around the brain.