In the early days of the railways many routes were single track and there was a problem in that signalmen were liable to forget they already had a train on a section of track and would release another one on to the same stretch of track. This was remedied by fitting each signal lever with a label saying “train on line” which the signalman would place over the lever when he had accepted a train on that stretch. However, the signalman was a part of the communication system and was quite likely to forget to put the label on when a call would come through before he placed the label.
This was remedied by having a system whereby each train on a single stretch of line had to have a physical token allowing it to travel on a section of line. There were a limited number of tokens and only one was allowed to be out of the holding box at any one time. These can still be seen in use on heritage railways today.
With modern railway systems, signallers are responsible for much greater lengths of line but have track circuit diagrams to tell them where all the trains under their control are and computer assistance to enable them to manage a more complicated system.