Mostly by making it extremely difficult to stay in the country illegally.
They may patrol the border, but even the nk/sk dmz has holes. Everything else is basically theater.
But once you’re in, without a visa you can’t get a legit job or license, or housing, even healthcare. And if you ever get noticed by the police, they deport you. So its not a matter of getting in, it’s wanting/being able to stay.
Latest Answers