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.