Offshoring projects very commonly fail because companies dramatically overestimate the savings and underestimate the cost of communications, company culture, and experience. If you have a workforce which is delivering good results, there’s often a solid benefit to continuing that rather than chasing a mirage.
I've been part of successful offshoring at a few different companies. It wasn't "one and done", that is, we had to try different countries, different subcontractors, etc but it is totally possible to maintain quality AND lower engineering costs by 50-75% by offshoring.
For those interested, my best experience has been with workers in LATAM countries. Pry 75% were Brazilians. Great timezone and culture match also most of them have good written/spoken english.
I’m not saying it’s impossible but that it commonly fails due to those reasons. Timezones are a common source of problems but I’ve also seen a fair number of problems which basically boiled down to outsourcing putting more stress on existing management problems such as inability to produce specs or delegate, and micromanagement were amplified by distance and cultural barriers. Basically the organizational equivalent of saying “our monolith sucks, let’s use microservices” without first contemplating how the existing system got that way.
How would unions increase employment unless unions make employees less productive. You could claim that they increase employee's wellbeing, salary and make the job better, but it would likely have inverse effect for ease of getting the job. e.g. Film and fashion industries are unionized, but getting to them is significantly harder than software engineering.