The real reason is "make number go up". A few years ago, you showed the stock market (or your investors if you weren't listed yet) how amazing a company you were by hiring people like crazy, even if you didn't need them, and giving them all sorts of perks, including (but not limited to) home office. Now, the stock market wants to see blood, so you have to sacrifice people - not because you're actually losing money, but because you're not making as much profit as the stock market thinks you should, and therefore your shares are "underperforming".
this “square wave” effect is driven by interest rates … when the bank rate is very low investors will tolerate high level of gambling on growth (ponzi-like). as soon as money will grow anyway in the bank, then investors demand actual RoI
This tactic is wearing thin on investors. All companies doing layoffs as of recent have started to lose share value. AI or not.
I think investors are starting to see stress on the market for fewer working people contributing back as customers and investors themselves. This creates depreciation in share value as no one is willing to invest.