It takes some time before the order changes.
They are first ordered by their type (bought generals, tavern generals + marshals, bought explorers + expedition suppliers, tavern explorers, bought geologist, tavern geologist) and within those gategories they are ordered by their name or if they don't name their type.
Order is alphabetical from left to right so if you use numbers 10 comes before 1 so if you use more than 1 digit numbers you need to use leading zeros (01, 02, ..., 09, 10, 11, etc)