This is only true for sweatshop-type companies. For places you'd actually want to work there is no difference in comp based on the type of visa someone is on. It's more about, we want to hire this engineer, what legal checkboxes do we need to tick to get them here. Sweatshops do take up the bulk of the H1B quota though, which is what gives this impression.
This is exactly what I am talking about though. Most H1Bs work at sweatshops like Tata and this skews the statistics. For any place one would actually want to work at H1Bs are paid the same as any other engineer.