Meta, Amazon, hell even Twitter have reached out to me and my neighbors recently (my friend has an interview at Twitter next week). I believe even during hiring freezes these companies carry on recruitment because they're slow and can wait for the ideal role to appear in the future even if there's nothing available right now. So basically you'll get an offer without a job.
During freezes there's often exceptions for teams who've lost people, especially for critical roles. i.e. you can't increase count but you can keep it the same.
Recruiters are usually operating on weeks old info. They never find out when the freezes/cuts are coming until the day of, because any changes would tip off employees and lead to rumors/lower morale and productivity.
Not saying that the grandparent comment is confirmed, but they always keep recruiters busy no matter what until they themselves are laid off. AFAIK Google has pretty much paused hiring across all divisions.
Hiring freezes aside, it is possible to be laying off people and hiring.
Laying off your costly senior employees, while replacing them with cheaper entry-level employees, can be a huge cost saving and the loss in quality or performance may be immaterial.
This will of course depend on what the employees were doing and how many experienced/senior people you keep to supervise and mentor the new employees.
Even in "hiring freeze" situations, this can be done by replacing employees with cheaper contractors.
Yes, it sucks, but it's the reality of the market.
Sorry but sometimes the people hire are the last to know that there is going to be a layoff. Plenty of stories abound about people being hired right into a layoff.
Meta was aggressively recruiting until there was a surprise hiring freeze. It wouldn't surprise me if they were recruiting one week and laying off the next.