Parts of it is that when you're cutting an arbitrary number (like 5%) just because.... you kind have to do it "randomly" so that there's no claim of discrimination. If it just so happens that all you best performers share a demographic trait of the protected or protected-adjacent kind (sex, orientation, religious beliefs, etc.) you'd expose yourself to discrimination lawsuits by people who don't match that facet.
It sucks and it's a symptom of risk management being a leading consideration to the process of a layoff, more so than performance optimization or culture change, but that's how it "makes sense"