It seems to depend on the company, but based on my observations the people who are first to go seem to correlate strongly with people, who management does not like. The remaining layoffs are a weird function of people, who know what they are doing and can't ingratiate themselves.
In my personal experience the first to go are the non management highest paid employees, the degree of competence doesn't matter. The really good ones go before the layoffs. The next layer of skilled employees leaves between the first and the second wave of layoffs. Eventually you get a company of drones with some management on top of them. Possibly a lot of management because sometimes they contract the same very people they laid out because they need the expertise but they want to transform capex to opex.