No, it's definitely illegal/against the rules to deliberately pay an H1-B worker less than a native worker in the same position. That doesn't stop anyone from doing it. The program depends on the visa holders to report any wrongdoing; however, I think we all know what would happen should they complain. H1-Bs are considered even more disposable than your average worker, and have a fixed amount of time after being terminated to obtain new employment or face deportation. They keep their mouths shut, and keep getting paid less.
I've read that the suggestion that companies give a laundry list of requirements and experience needed for the job and list it as a "Junior" level position or call it a different type of position all together. Then of course they can't find a local especially at the wages offered.
Think about it, why else would a company employ an H1-B? They will scream and cry about a shortage of native workers to fill open positions, but they're full of shit. There are more than enough native workers to fill the positions; there just aren't enough native workers available at the salaries they want to pay. So, in a sense, they're not lying about a shortage, but it's a shortage of their own creation. That, and frequently a company will identify an H1-B they want to hire and write a job description so specific to their skill set that they can claim there aren't any qualified native workers. Which is true; nobody has the exact same skill set as someone else.
If there were such a shortage as people claim....
- Wages would go up, especially faster than inflation, which I don't think has happened over the last 15 years, based off of some data I saw.
- We already graduate more people with a STEM degree than vacancies every year, and that doesn't include people with a STEM degree working outside of STEM