Those particular cases have benefited by the shortcomings of the USA actually. I know some big tech companies send workers who weren't able to secure US immigration specifically to offices in Canada, the UK or the EU. For example Meta and Google [1][2].
One can expect the company then grows an interest in developing full engineering teams in these sites. One can also expect some people might simply decide to not come back to the USA.
With the general rise of China's tech scene, recently there's been a trend by which the USA doesn't retain Chinese international students and they instead opt to return home. One has to imagine the very, very long immigration process they have to go to has to do with this [4].