Depends on your ethical alignment. If good some are retrained for newer ships and others are retired with a nice pension and full benefits. If neutral they are retired with your heartfelt thanks for their service and a minimal pension. If evil they are sent to the crusher along with their ships (generally known as retirement with extreme prejudice.)