"Levies" are allowed to retire/desert at the end of a battle, if they do the bare minimum in it.
Fortunately, the "bare minimum" isn't just showing up! They have to do one of the following:
Desertion happens at the end of the battle, so it's not like these things have only 1 HP.
Simply put, Levies are Resource-cheap. If you have the Gold, you can pile up a ton of them in a single turn.
Aside from that, there aren't a lot of levies. Only two kinds of troops are levies, the Gladiator and the Retiarius, and they're only in the nations of EA Ermor, MA Pythium, LA Pythium and Sceleria. By human standards, both levy types are rather above-average at dealing damage, and their high HP and Morale make them decently persistent in the one battle they'll make a difference in.