And it is often in the interest of each country to prevent an influx of additional (lower wage) workers in trades that already have enough workers.
A parallel can be seen of how Walmart entered rural and small town America years ago and killed many local businesses. It also lowered local wages, because the primary job became Walmart Checker.
If you are a country of 330 million people, and you do not put limits on countries 5X larger, then you will find your citizens less employed and lower income.
This is not racist, nationalist, or any other label. I suppose you could label it "localist", whereby you favor local resources over remote ones.
The excuse used by tech companies starting around 2000 was that there were not enough talented local workers, so importing cheaper (and often lower skilled) workers was the answer. That's not to imply that all foreign labor is lower skilled. However, displacing local workers with foreign workers without some quality control, especially where the pay is lower, will result in an accumulation of lower skilled workers.