Not all who were let go were underperformers: For every older employee let go for legit reasons there is a younger employee let go to balance-out the age to protect against age-discrimination lawsuits, similarly if there were too many young inexperienced people let go, the company needs to pick random older employees so as not to look like they are discriminating against age. Other categories exist too, not just age. For example if there are too many white people let go, then the company needs to pick random non-white people to let go. If too many women were let go then they need to pick random men to let go.
This is 100 percent correct and it's why nobody can consider himself or herself safe. The company has to be careful not to bring on either a single or a class action suit regarding layoffs, and as a result, they have to lay off some people they otherwise would not want to remove - just to balance the numbers. It sucks, but that's the reality. No matter how good you are, you can be affected because they need more younger/older/men/women/white/PoC/etc. employees gone.