A starship requires a crew to operate. When a starship is built, it starts out with a full crew. The size of the crew depends on the starship, and varies from 1 to 2910. The exact source of the crew is unknown, but it doesn't get pulled from the planet's colonists.
Crew can be lost in a number of ways, the most common being combat, flying through the radiation halo of a star cluster, or strong ion storms. In ship-to-ship combat, if all of a ship's crew are killed before the vessel is destroyed, it will be captured. If all of the crew dies due to radiation, the ship will become unowned, a "ghost ship" that any player can claim by towing it.
Crews can gain experience from traveling through space and through combat with enemy starships; alchemy ships can gain crew experience through performing their alchemy. This ability is only useful in preventing damage due to ion storms.
Starships that transfer ownership through starbase surrender will have their crews replaced automatically, as will ships that are given through the gsX Friendly Code. Ships captured through tow capture will gain some crew from the capturing vessel; a portion of the crew may opt to remain aboard, but the rest are neutralized.
To replace lost crew, take the ship to a friendly starbase and use the base's Fix option.