The executives making the decisions on who to cut try to balance out a number of factors. Value of the role to the organization, performance, salary, length of service, team fit, risk of lawsuits based on age, DEI, etc... Some of these decisions are fair and objective, if you are having a layoff it's good to eliminate the driftwood in your organization and the people / teams that are not providing value. Sometimes these factors along with personal relationships with management result in the wrong people being cut / retained.
I am sure you can look at some of the people who were let go and question why they were cut and conversely look at some that were retained and question why they're still around. Rarely do all the decisions make sense, sadly the people who make poor choices in this area will rarely be held accountable for bad their bad decisions.
All we can do is support the people who lost their job and wish the ones that are left to pick up the workload the best.
@1czs+1kX9geBc said it perfectly.