I hire for such companies and the quality of US workers vs foreign workers who move here on visas is much different. To be fair, foreign workers who move here on visas tend to be the rich and highly educated of their own country and US workers are more distributed across SES. They also have more education on paper bc they usually need a masters or more to be eligible to work here
The compensation of software tech (especially Silicon Valley) has also gotten much higher over the past number of years in the US compared to disciplines requiring the same level of education/experience both is the US and even Western Europe. I expect this will equalize with outsized tech salaries becoming a thing of the past except for a few individuals with proven track records.
I mean, the same can be said for consulting salaries, HFT salaries, hedge fund salaries, etc., which similar to software engineering only require a bachelor's and have a similarly grueling interview process.
Why would this equalize? As long as software companies make huge profits and have growth capability which the top ones clearly do, what change would make this happen?
Some software companies are making huge profits today. Many software jobs are at companies making returns comparable to other engineering job profits. There's also a supply side. If the market is flooded with a lot of people in it mostly for the money, salaries will supposedly shrink.