According to some people I know (they are all on H1B) typically H1B offer is 10-15% less than average at software big corp such as Microsoft and Google.
The law is that the H1-B is supposed to be used in those (rare) cases where there are no Americans that can do the job. Frequently "the best person to do the job" is loaded with subjectivity. But also, it is against the law.
Maybe the hiring salary is on par with other engineers, but later on it is easy to never touch this salary since the non-immigrant worker is bound to staying with Google or be deported.
Differences in salary are negligible? Well, then let's give a 10% raise to all engineers employed by Google, would that work?
It's not just about paying H1Bs less than American workers, it's about keeping salaries low for these very workers as well.
A result is that the leadership of these firms are worth tens of billions of dollars in the case of Google (two leaders), Microsoft, Facebook). Instead of sharing the benefit of the "monopolistic rents" the leadership hire H1-B visas and also colluded with each other to keep tech labor rates low.
https://en.wikipedia.org/wiki/High-Tech_Employee_Antitrust_L...
Why do people keep repeating this? It's not true. You can totally change employers on an H1 (I've done it twice). It just takes longer; 4 weeks to transfer your visa + 2 weeks notice. Your hypothetical Google H1 has recruiters contacting him/her day and night.
But having a H1B comes with a stigma, not all companies are willing to get involved with a new petition.
And let's burst the myth of the "grace period", it doesn't exist. If you're fired you have literally 24 hours to leave the country. There is no "2 week grace period" to find a new employer. So yes, it is possible to find a new job, but it makes it very difficult to fight back when you're asked to work nights/weekends for example.