Not so much about leaving the country, as about knowing who from there is in your country. Most of the point of requiring a visa for entry (at this point in globalization when very few countries are ever actively at war) isn’t stopping people from entering, but rather knowing exactly who’s entering, and then being able to track them from the time they enter until the time they leave, if you feel the need to.
As well, when you don’t trust a foreign government to ensure that people only get passports for their own identity, you can’t be sure that a random person coming in with a passport from said country isn’t actually a Person of Interest. So, you require they fill out a passport-like form in your own country, and then try as best as you can to figure out if they are who their passport says they are. That’s a visa.
As well, when you don’t trust a foreign government to ensure that people only get passports for their own identity, you can’t be sure that a random person coming in with a passport from said country isn’t actually a Person of Interest. So, you require they fill out a passport-like form in your own country, and then try as best as you can to figure out if they are who their passport says they are. That’s a visa.