A ruler could issue a pass porte to his officials allowing them to enter any city in his realm free of charge. The first ruler to issue a pass porte that asked foreign cities to allow a person to travel without paying fees was King Henry V of England. Most cities were happy to allow his diplomats free passage as a sign of friendship. Such pass portes continued to be issued in small numbers by rulers over the following centuries.
On the outbreak of the First World War, countries imposed border controls to block the entry of subversives and the exit of men with skills useful to the war effort. Passports were issued to allow travellers access through these restrictions. When peace came in 1918 most countries retained both border controls and passports.
In 1920, the League of Nations standardised passport design and function. These standards have remained in force, subject to occasional revision by the League of Nations and more recently by the United Nations.
Answered by Rupert Matthews, historian and author.