Layoffs don't help companies unless they can reliably remove the worst parts. At most large public companies, the cancerous bureaucracy protects itself and the parts removed are closer to median performers, or even above-median performers. The system gets smaller and less efficient.
Layoffs can be necessary to get the company to fit through a certain sized hole (in the form of cash flow constraints), but it won't be better at what it does on the other side of the hole, it will just continue to exist.
Layoffs work when there is an accurate discriminating mechanism for who stays and goes. The best example of this (outside of private equity turn-arounds that are not widely known) is Twitter. Outside engineering talent was brought in as an oracle, immune to Twitter's bureaucracy. It reliably discriminated between value-adding and not. As a result, the company became incredibly lean and even consistently profitable.