For example, if you have multiple ranged units of different cultures, skill level, or even weapon type (between bows, crossbows, and throwing weapons), these will be assigned to the same number as ranged units by default. The particular troops which are assigned to each number by default will depend on the structure of your army. You can also change which keys activate specific orders and formations from the same options menu.
You can change the number which specific groups of units are assigned to from the Order Menu in Mouse and Keyboard options in game.