Sometimes, a law has an undesirable side-effect. Sometimes these side-effects are obvious, but not noticed by politicians.
Let's consider UK immigration. Currently, this is running at 612,000 per year (2019 numbers) of which 200,000 is EU and 333,000 is non-EU.
Net migration (immigration minus emigration) is -52,000 British, 59,000 EU and 219,000 non-EU
This means that EU immigration is a small percentage of the total, and leavng the EU will have no effect on the 219,000 non-EU immigration. So, leaving the EU isn't going to have mush impact on net immigration.
Now let's put a points based system in place. This means that instead of unskilled people coming to the UK, there will be skilled people.
And that means that the availability of jobs as fruit pickers and labourers will be greatly increased, which will lead to more British-origin people doing those jobs. And at the same time, the availability of jobs for skilled people (programmers, dentists) will be decreased, as the points-based immigrants will eagerly go after those jobs.
But, of course, automation is the real job-killer.