AI is only a very small part of it. Before, during, and immediately after COVID, tech companies were hiring like mad. Way more people than they needed, warehousing software engineers either just because or perhaps to try to keep them away from competitors. Seeing this high demand, more people went into software; the number of bachelors degrees awarded went up from ~64,000 in 2016 (when it was already on a rising trend) to ~108,000 in 2022.
Then we got higher interest rates, Musk proving you COULD run a service with far fewer people, and the Section 174 R&D amortization rules kicked in. Tech companies started cutting back hiring, even doing layoffs, at the same time a lot more graduates entered the market. Result: a shit hiring market for new grads. The Section 174 rules have mostly been reverted and interest rates are starting to drop, so the job market will probably get better. Prospective students are noting the shit hiring market now and (on the margins) choosing other majors, so in a few years we'll probably hear shrieking about shortages again. But for now, it sucks to be a CS grad.