I will make an argument for the cynics that believe they should be protected from competition: that immigration restrictions and caps like the H1B curtail the freedom of Americans to buy services from who they want to. American people that run American businesses are prohibited from hiring people they believe to be best suited for the job.
There is not "gaming" the visa or "outsourcing companies". US consumes software engineers from abroad at 100x its software engineer immigration, only that they don't pay taxes to the US and export close to 100% of the their trade. It would be much better for the us to bring the people inside America to pay taxes and provide more value for Americans.
Incredible to see software engineers buying an apple phone made in china and argue that Americans should not be able to employe chinese software engineers.