I'd guess AI has made the average SWE around twice as productive at this point. This is a sort of efficiency shock, where companies suddenly need to find twice as much productive work to do or start firing employees. FB probably had a bunch of slack to absorb this but ultimately it's just hard to find that much work all at once.
I predict that tech companies will hire back a lot of this lost headcount over time. Although AI will keep getting better, so there's more downward pressure coming. Facebook, Amazon, and Google have had flat headcount since 2022, and this layoff will reduce FB's size back to 2021 levels.