The reality is that most of these companies are and were woefully overstaffed.
AI is just the excuse: companies are now trimming the fat. Forced hiring for many reasons, including non-merit based ones, and now the chickens have come home to roost. Except, they are velociraptors.
I lived through the last great purge in tech after the "dot-bomb" in '01. I think the only thing making this possibly worse is the scale. But I can't pretend it's not needed. The amount of people I've been watching say "I got a job in cyber", or "I got a job in AI" when in reality it was sales, HR, or some other administrative role has been mind boggling.
I could go on and on, but the simple fact is that this series of events while unpleasant is necessary: "creative destruction."