Never in any layoff I've been a part of, have the least talented workers been let go first. It's usually by category: contractors, age (early-retirement), department, or job description.
I've seen some layoffs and the first to go where the people the most "unproductive". So, there were sale people (which were actually pretty decent, but they "cost" money and had to go), and then there were also people who were just "less" good. Less senior, more junior and could not do things autonomously.
But I can agree that it's always very subjective and of course the one who is friend with the boss ABC will have more chance despite maybe performing less good...
I have seen a lot of layoffs over the years and I would put the main targets into here buckets:
1. People with bad relationships with he boss and bosses boss.
2. People with higher salaries.
3. Unlucky folks where an entire line of business or corporate department is shut down.
Number 1 is the vast majority of the cases. Make sure your boss smiles when they see you and you can sleep well at night.