Hello AmGirl
On enlistment a soldier was given a number which was unique to him in the battalion [or equivalent unit] that he joined. If he was posted to another battalion or regiment/corps he would be given a new number. If he was a Territorial soldier, the same applied, but the whole of the Territorial Force was renumbered in 1917.
Unique numbers across the board were introduced later.
The whole subject is a minefield, and if I had included 'usually' in each phrase above, some of what I have written will probably be right!
As an example, if you put a number - say 1234 - into the search box for WW1 Medal Index Cards at the National Archives Documents online site, you get 271 replies.
My reply is based on the British Army which is where most Britons served, but other factors almost certainly applied in the Royal Navy.
A
If you have an individual case, let us have the details and someone may be able to help.