Very profitable companies have gotten away for years with the tired argument of not enough talent. It is easy for engineers to fall for the line, since it pushes our egos in the right way: only really talented people can do what we do.
The truth is, tech companies are spoiled. They all want the top 5%, but don't want to pay the premium. And they've found that since they can't always get these 5% for cheap, they might as well get the bottom 50% for a discount via H1B indentured servants.
I like software engineering a lot. But the older I get, the more I know that it is a dead end, and I'm preparing my pivot. Not because there isn't a demand for software, but simply because the tech field is full of naive and professionally weak workers that allow the whole industry to be exploited far more than other professions.
Globalization, offshoring, etc. is not something that can be easily countered. Even lawyers, journalists, and nurses - typically very politically savvy professionals - have not been able to counter it 100%.
But tech workers are really at the bottom of the barrel as we not only lose to offshoring, but also allow ourselves to be arbitraged and later replaced by foreign workers in our own countries (from what I've seen, Western Europe is catching up with the US with its 'blau karte' and other schemes).