Warp Core Ejection System
Whenever a warp-capable ship with a Matter-antimatter reaction-based core suffers a catastrophic failure, it is a serious threat to the safety of that ship. A "catastrophic failure" is defined as complete, irreparable, and rapid damage. More often than not, this damage comes from external sources, such as from a battle. If the warp core or any of its major sub-systems fails, the resulting explosion would instantaneously vaprize the ship. The best chance for survival is to dump the warp core into space and move quickly away. This is done by a warp core ejection system.
Ejecting the core from the ship is always a last-resort measure. Every effort to secure it and isolate the damage is made before a decision is made, including sending in protected engineers to make critical repairs. The normal emergency procedures involve severing all fuel and power supplies to the core, followed by the immediate sealing-off by redundant containment fields. Both the computer and damage-control personnel then assess the damage to determine if all or any part can be repaired. If the pressure in the containment fields passes a certain point or the damaged core threatens the structural integrity of the ship, the computer will automatically initiate ejection protocols. The core can also be jettisoned by order of the Chief Engineering Officer (or the person acting as) or a senior command officer.
All Starfleet vessels are equipped with this system, as well as one that can eject the contents of the Antimatter Storage areas. Since most antimatter aboard is slated for use in the core, it is usually stored close to the warp core with lots of piping and conduits between the two. Damage to one can cause damage to the other, despite redundant safety systems meant to eliminate or reduce failure conditions.
Jettison is accomplished either through 1) large "blow-out" plates in the hull or 2) a retractable hatch. After the core (and/or antimatter pods if need be) is sealed off, the plates are unlocked (or the hatch opened) and rapid decompression is typically enough to eject them clear of the ship. Compressed air can be pumped in behind it to assist if need be. Once clear of the hull, the ship (usually under impulse power) must quickly vacate the area. Under ideal circumstances, the core and/or pods would be detonated from a safe distance. Safety and security protocols state that neither can be left free-floating in space.