There are 2 Ranks: "Veteran" and "Elite".
Heroes get 4 Ranks: "I", "II", "III" and "IV".
The act of levelling up a unit in Iron Harvest is one built upon the idea that you want your units to survive for as long as possible. So, consider this a reward for survival. When ranking up a unit gains a significant health and damage increase that gives it just an edge in battle. They also gain an ability of some sort.
The way units level up specifically is via a plethora of things, such as attacking/killing units, healing allied units, repairing buildings or mechs, and other niche things as well.
As a bonus note:
When a hero dies and gets revived at the base, they will lose their rank. However, should they get revived on the battlefield, they will keep their rank.