And why not? The offshoring of work reduces the cost of goods and services and frees American time up to do meaningful, better compensated work instead.
The eventual conclusion (perhaps even in our lifetime) of automation and offshoring will be that Americans will not have to work for the necessities of life at all, just for self-actualization and luxuries.
And what if she gets retrained and into another job? Why, isn't the best thing that could happen is that she should lose that one, too, helped by our good friends running H1B?
It would not collectively lower wages across the board, it would leave many completely unemployed and the rest earning double or triple or fifty times what they're making now in real terms.
The solution is a basic income so those that are unemployed don't suffer for it and have a long runway to work on art, hobbies, retrain, etc.
In general, in a free capitalist market the government probably shouldn't be subsidizing corporations in any way.
In real life, governments need to negotiate with corporations, because individual politicians need corporate sponsors to finance their campaigns, so they sell their influence.
What I think has happened here is that the government got out a bullhorn, pointed it overseas, and said "if you study engineering or computer science, we will give you a path toward citizenship and/or residency in a lucrative market through specialized tech visas that will not be available to general would-be immigrants." It then turned around with that bullhorn toward the United States and said "if you go to law, medical, dentistry, or even nursing school, we will protect your jobs through government backed professional associations and unions, and even in the absence of special protections, most fields and trades will require existing right to live and work in the US. Oh, and also, there's a shortage of Americans going into STEM."
Here's the thing, if make it much easier, through regulation, for immigrants or foreign consulting companies to enter the tech market than the legal, medical, or other markets, you should understand you've created an incentive for foreign workers and companies to focus on tech, and US citizens to avoid it.
Think of it this way - lemons and avocados are grown in similar conditions. People can't buy lemons for what they used to pay, so the government declares a shortage of lemons. From now on, lemons will be exempt from the 20% tariff that is placed on avocados, and the government will grant a temporary residency visa to any farmer who wishes to immigrate, provided he agrees to grow lemons only (if he stops growing lemons and tries to grow avocados, he will be deported).
You would expect people who already hold US residency rights to move into avocados, and away from lemons, right?
But this isn't the result of markets, it's a market response to severe distortion created by US government policy.
I think we've done something much like this in high tech and science/engineering. The "shortage" of US citizens going into these fields is a rational response to uneven government regulation.
This is why I'm ok with general immigration, but generally opposed to targeted visa programs designed to cure specific "shortages". I think that they are almost always used to suppress the wage growth that would draw people into the field and reach market equilibrium.
There is data to back this up - the RAND institute, historically a very pro-immigrant think tank, reached the conclusion that US citizens avoid Science and Engineering graduate programs because they are not competitive with the other fields that are available to high achieving students. But here's the thing, those fields are only available to people who already have citizenship!
Oh I could fill a page about how disgusting I find professional associations and unions, but it's probably off-topic here.
Every student who comes here is on H1B after they graduate. They go through a lot of pain and effort to get a permanent residency because they get stiff competition from the employees who come directly and are on the same visa status.
Instead of H1B, we should update our immigration laws and policies to prefer educated people of means who have a desire to come here and contribute to our country.