Experience is a hidden statistic of Units, hidden even from the unit itself. Experience is gained through croaking non-allied Units in battle. Once enough Experience has been gained, the Unit gains a Level (or in some instances, more than one). The leveling event can be something of a surprise to the unit.
Units in Erfworld have difficulty determining how much croaking it takes to gain a level for two reasons. First, the statistic is not available to be seen, and the amount of experience gained from croaking an enemy unit is not known. Second, it is difficult to arrange for a set number of particular enemy units to be available to kill in order to run an objective test.
Warlords may gain experience from winning battles, as well as from croaking Units. (Stanley is angry that his Warlords won't Level up from retreating, but not worried that his precious dwagons won't. This suggests the dwagons still gain experience for croaking enemies, regardless of the outcome of the battle.)