Ship Death
The end is nigh, captain. Time to abandon ship, for if you don't, you will certainly perish with your ship.
You've got one last chance though. You can eject from your ship before it blows up, and your emergency survival gear will allow you to survive in space for a short time, during which you have a chance to be rescued by a friendly ship.
When a starship has blown up, some of its cargo usually survives, floating in space, and can be looted by any ship that comes along and can hold it.
Ship Replacement
So your ship's been blown up. Do you have to go through the process of outfitting another ship just like it?
Thankfully, no, not if you've purchased ship insurance from the Stellar Insurance Corp (SIC). If you have, then they will have an exact copy of your ship ready for you in a few minutes. They're that good!
The upside to SIC is that they insure your ship even though they know you're going to go out and get it shot up, and they do it for a small fraction of the cost of buying/building your ship from scratch.
However, the cost to re-insure it goes up a bit every time your ship is destroyed. Whether that's a big deal in terms of cost depends largely on how big of a ship we're talking. Small ships are not particularly expensive to buy or insure, while very big ones are substantially more expensive.
Think we're pretty cool? Tell your friends!