im not sure if there an order that units are tossed into commanders with others tossed into cities.
Personally i would prefer they kept the units(their replacements) in the commander if they are already in them, assign units to commanders based on proximity, then assign the rest to other commanders/settlements.
Alternatively, on the first turn of the age, let you instantly assign troops via the reinforce button to commanders. Fixing the commanders can be annoying to the point where you just buy the troops you need to fix them rather than wait 15 turns for them to get from homelands to dl or back.