The was a time when any foreign national who wanted to enter Britain had to apply for a visa.
To get a visa you had to have a valid reason for wanting to come to Britain, your character was also taken into consideration and if you were deemed to be a liability or not of good character you didn't get in.
There was also the concept of the undesirable Alien which meant that foreign nationals who misbehaved could be deported quickly.
Nowadays once someone gets into the country illegally they can claim asylum which means it can take years and a lot of money to get them removed, that is if you can get them removed at all.