Commanders are special units that represent your hero's physical presence on the map. Mechanically, they function the same as an attaché, except that an army can host both an attaché and a commander at the same time.
Commanders & Army Units
When your commander is attached to an army unit, the army unit is considered its host. Like an attaché, the commander unit moves wherever the host moves.
Because commanders represent your hero, it's more difficult for a commander to be captured by the enemy.