You gain rank by completing levels. You get credit for completing old levels but you gain credit to the next rank faster when you complete new levels. In the earlier ranks you move up/ get a new frame, every 5 levels but later on it is every 10 levels when the yellow bar is completed. When you gain a new frame it also gives you 5 new lives.