Crew compartments of such vessels are designed to act as lifeboats in an emergency. During normal operations, the handwavium used in the crew compartment is part of the lifting power of the whole vessel, so that it's not wasted.
In an emergency, all the crew must move to their designated rescue locations in the crew compartment which will shortly break away from the main vessel and become a lifeboat. A small vessel probably has just one compartment, while larger vessels may have more.
The detached compartments have just enough floating power for the occupants, and possibly very meager accommodations, propulsion and navigation (depending on the original vessel's mission profile). In that state, the its main function is to keep the occupants afloat until help arrives.
The detachment event possibly dooms the rest of the main vessel, as it loses even more lifting power. On vessels with multiple compartments, it is better if all of the compartments detach at the same time, because doing otherwise may affect the balance in an undesirable manner. Still, in a real emergency, there's no telling if someone will panic and detach prematurely.
Hulks of evacuated vessels slowly sink to the high-pressure hostile layers of the atmosphere, where they somewhat stabilize. There are specialized salvage/rescue vessels that can navigate there and get valuables out if needed, but it's hard and dangerous work. Most vessels are written off as casualties. Some people are trying to develop remotely operated salvage drones that can cut away the dead weight and let valuable handwavium float up to higher altitudes where it can be recovered a bit more easily.
Civilian vessels have a good safety margin, and are able to stay afloat even when damaged. That margin is much narrower in military vessels, as they prefer to squeeze every drop of lifting power for performance or payload capability. Therefore, most modern military vessels have the ability to voluntarily eject some of their mission payload (weapons, ammo, fuel, cargo etc.) to keep it afloat when damaged. Even armor plates can be ejected to lose weight in an emergency. Vessel commanders have successfully used the tactic for a speedy retreat when in dire circumstances. Others have literally "dropped their weapons" to signal surrender.