I am sure there are some people getting laid off who genuinely don't do any work, though not 5% of the company - and certainly not the bottom 5% according to Meta's metrics! A lot of "mid-range" performers probably get by with pure schmoozing and mooching. And in more general sense, I don't think it's okay - either morally or strategically - to lay people off simply because you want to roll the dice on hiring more productive workers. (For a company of Meta's size this doesn't even make sense; clearly this move is about cracking the whip for the remaining 95%.)
Performance is only adequate if it’s at least as good as the engineers of the other players in your industry. Otherwise, you’re losing ground. As long as anyone in your market space is actively trying to manage their engineering talent (recruiting your top performers, releasing low performers, being more selective in hiring) so must you just to keep pace. An “adequate” engineer may make the company money, but the opportunity cost of not hiring someone better who could make even more money can be higher still.