Experience is a hidden statistic of Units, hidden even from the unit itself. Experience is gained through croaking non-allied Units in battle. A battle must be finished, however, to earn experience (however this is contradicted by Bogroll's gaining of levels upon croaking Ansom as the battle was not yet complete). If you withdraw, you gain nothing, despite how many units you may have croaked. Once enough Experience has been gained, the Unit gains a Level (or in some instances, more than oneErf-b1-p132). The Leveling event can be 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.Erf-b1-p055 (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.)