But the specific roles being laid off are arbitrary, and the overall goal headcount reduction is driven by macroeconomics factors (I'm being generous there), not based on new efficiencies.
Note the difft between "cost cutting" (do less, to lower cost) and "efficiency" (do same, but with less cost)
The goal of these cost cutting initiatives is not an absolute reduction in cost, but a relative one. They needed to show an improvement in operating margin, ie % of revenue spent on engineers.
If your engineers become 20% more efficient then your margins are better and your problem is solved. (Indeed if you have tech that can make any engineer 20% more efficient then you are back in the game of hiring as many as you can find, as long as each added engineer brings in enough additional revenue.)