Defeating all the levels and bosses on a planet or spaceship unlocks the next planet or spaceship.