I'll let you work out why companies might prefer hiring people with less experience, or discriminate against older and more experienced people -- a practice so widespread in tech we joke about it. Hint: seniority usually implies higher pay, lower chance of getting blinded by free pizza and dry cleaning, and more independence of thought in the workplace. Less work experience usually means a more compliant employee.
A more cynical take: the tech companies, especially FAANG and the startups that emulate them, over-hired to hoard "talent" and slow down their competitors. And they based their hiring binges on bad ideas like "the metaverse," or more generally sustained crazy growth as if markets never mature. The layoffs then represent the workers paying the price for poor management and short-sighted decisions, and pandering to Wall Street and VCs.