If not: in general, in the US, it's perfectly legal for a company to just arbitrarily decide they need to fire N people, and arbitrarily choose a particular person to fire meet that "quota". This is true regardless of how many layers of managers are involved, or what bullshit PIP hoops are jumped through.
There would only be a legal issue if the worker was subject to a bona-fife employment contract (quite rare) or if they were discriminated against on the basis of a legally protected characteristic. Just being the least senior member of a team is not legally protected.
It's funny -- I've never heard that these were rare except in comments on HN, and with every job I've had in the industry, I've had a real employment contract (along with all of the devs I personally know well enough to know that about them.)
Is this "employment contracts are rare" thing a SV norm, perhaps?