There are actually four large “buckets” on H1B usage in software. First are the “regular” software jobs. At the large tech players or other regular companies (eg a software job at a bank). Like you said, there is a lot of supply due to layoffs and not a lot of demand. H1Bs in this area are also limited this year due to this.
Second are the college graduates. Once you complete a STEM degree as a foreign student you get three years of OPT which is for all practical purposes a work permit to work in STEM jobs (with some conditions). If the student (now employee) needs to continue working for the company in the US after this they need a H1B or a green card. Most genuine companies apply for H1B for these employees the moment they join and because it is a lottery keep doing it in the hope that the employee gets a H1B and continues working. These are not new jobs but people in jobs for up to 3 years that the company wants to continue employing and does not intend to layoff. Supply and demand plays a smaller part here.

Third are the outsourcing companies, TCS, Accenture and the like. These companies have people in India and contracts with large Us companies. They predict some number of demand for moving people from India to US (to help support the rest of the offshore team, to replace a higher paid employee at the US company with a lower paid employee of the contracting company etc). These companies will mostly but just barely follow the law (they have also been caught and paid files) and will use all loopholes available to them. These are the biggest “abuses” you see in the press. While the general “abuse” news in the press is about these companies replacing American workers with lower cost H1B employees the other problem is they are not catering to current demand but predicting work at a “client” based on current or future contract, creating “job openings” based on this (which they can, it is their own company) and flooding the lottery.

The fourth are smaller body shops and “consulting” companies in the US. These also predict demand and “create jobs” to enter applicants to the lottery. But the difference is typically the companies in the third category don’t get the employees to the US if there is no “client project” (as in, real demand) and even if they they do, they have the means to pay the minimum required pay the H1B demands - they are big enough to afford a bench of employees. The companies in the fourth category will get people to the US first on fake, or near-fake demand and then pitch them to “clients”. In the meantime the employee is not paid the companies skirt the law in all ways as possible to continue “holding” the employee. They also refuse to share paperwork with the employee (preventing them from moving jobs) and sometimes have the employees pay for the H1B which is illegal (but gets to the grey area if they get the payment in India before the employee travels to the US).

There is very less demand today in the first category. The second category is not much related to demand. Most of the “abuse” happens in the third (by volume) and fourth (by severity). Abuse in quotes because a lot of this is in the gray areas of legality and sometimes outrightly legal but not “right”.