If I fly a capital ship into a battle and know I am going to lose, I get out.
There are some of my characters, all of my fighters/bombers/gunboats and one or two of my larger ships, that will fight till their ship goes boom.
Mostly though, I like keeping it realistic by getting out of the battle and living to fight another day.
If my fighter etc does go boom, I RP it as getting another.
If my larger ship does go boom, I RP it as the ship suffering extreme damage and being rescued eventually and then undergoing repairs. So I leave it docked for a few days at least.