Yes and no.
Most companies I see using H1-Bs are startups looking for people to get technical work done as cheaply as possible. These are the same people who give employees 0.1% of a series A company and whine about how there's a "skill shortage".
When in truth, there is no "shortage" -- it's just that software engineering is one of the only (somewhat) high-end careers subject to absolutely no credentialing whatsoever, meaning, if you can get someone here (to the US) and they can do the work, great, they're hired.
Contrast this to the absurd coddling present in other professions. Doctors, dentists, lawyers, architects, etc. have massive barriers keeping people out, competition down, and in the end, prices of their services up.
It blows my mind what middling lawyers can charge: $300/hr or more for mediocre law work for my California HOA. These people have zero side projects, don't study a minute out of work, and work strict 8-hour days, with the expectation of earning $250k/yr or more mid-career. This is what the cream of the crop in our field earns (Google SWEs making 350k or so). The cream of the crop for layers make millions/year at places like Cravath or Orrick billing $1000/hr or more. Even my wife, an architect, is now billing out at $250/hr.
It blows my mind how underpaid software developers are, given how difficult the work, and the working conditions are, compared to other similarly demanding fields in terms of professional education, and raw intellectual horsepower required to do the job. A typical H1-B can be productive a few months after a good software education anywhere in the world, assuming they speak passable English. My best friend's sister-in-law, an Indian dentist, had to retake the last year of dental school before she could touch a single tooth in the US.
The biggest winners from the H1-B regime are high-skilled professionals in the US. Low-end labor doesn't care about any of this. They work for cash, and still pay sales and property tax (through rent) just like the rest of us, and all for absolutely zero government benefits.