Each ship has its own level of experience. All ships start at level 0 and gain experience points for defeating enemy ships. The experience bar and level can be seen to the right of the ships name when highlighted, the level can also be seen when bringing up the ship options.
When a ship levels up, its maximum hitpoints increase. Small, experienced ships may often have as many hitpoints as a ship the next hull size higher. When upgraded, ships retain their experience, so it may often be beneficial to keep a handful of your most experienced ships and upgrade them as opposed to scrapping them when they become obsolete.
The amount of experience gained depends on the difficulty of the defeated foe. Thus defeating a defenseless freighter may grant no experience at all, while shooting down a massive battleship will grant a substantial amount of experience points. You can see the progression towards the next level as the twelve bulbs under the level light up.