Just speaking from my experience -- if the company is a big corp, usually the wages follow average market rates (I was paid market average wage in a top advertising corp in the world and I got my green card there in 6-7 years). Bureau of Labor Statistics puts out average market rates for each job category and the H1B sponsor has to match or pay above that to get the H1B application approved. I was also checking out my market rates (i.e., applying for other companies that allows H1B transfer) constantly during my H1B time because I can move to another job if my current company was paying me lower than average wages.
On the other hand, for some shady companies that are set up as contract shops, then I'd not be surprised if the wages are lower than average market rate, but I have never worked at one, so I might be misleading by even mentioning this here.
You seem to be genuinely curious, which is commendable.
>Will that apply to every law in society or just to H1B laws?
The H1B laws are harder to enforce than most laws -- or so it would seem to me -- because the question of whether there are Americans that are able to do a particular job at a particular workplace depends on many fiddly details that only the managers of the particular workplace (the prospective defendant in any enforcement action) would know.
When lawyers working on Capitol Hill are serious about stamping out a behavior, they write laws that are easy to enforce (unambiguous, not relying much on human judgment). Something as vague as, "as long as there are no Americans qualified to do the job," suggests that whoever wrote that just wants to reassure critics of the H1B program without caring much whether H1B workers actually displace American workers.
This is the lump of labor fallacy. People are both consumers and laborers; by bringing someone new into a labor market you marginally decrease demand for their skill set but you also marginally increase demand for all other labor. If H1-B visa holders all worked in the same industry, it could conceivably lower wages in that industry but they don't. They work in everything from healthcare, to IT, to education.
Your question is why is it wrong to depress wages? Yeah, really tough question.
Now consider OPT visa workers which are being paid even less, plus companies get an extra 8-10% discount because they don't have to pay Social Security and Medicare.
There is no shortage of skilled workers here. Only corporate greed.
I have only seen anecdotes while the law explicitly states H1Bs should be paid the prevailing wage or above.