Passports are travel documents that vary across the world and over time. Some are proof of citizenship, some aren't, but all are identification for travelers. While they were used here and there thousands of years ago, they were fairly rare before World War I. Only after World War II did they become universal, and even then enforcement varied.
As witnessed throughout history, the rules don't always apply to everyone. Take Paul McCartney, who in 1967 was travelling to France and forgot his passport. As the story goes, he allegedly pulled the "you know who I am" card and was allowed to board his flight. Meanwhile in 1976, due to a law that anybody (dead or alive) travelling into France officially requires a passport, Rameses II (who died sometime in 1213 BC) required one so that his remains could travel to Paris for study. The Egyptian government did indeed issue the ancient pharaoh a passport.
An article on passports at Messy Nessy Chic doesn't pretend to be a comprehensive history of the passport, but contains plenty of fascinating tidbits about passports in history.