If it's the latter, I'd like to challenge the assertion that a PIP is necessarily the company trying to get rid of someone. In my experience as a manager, I've always made sure that PIPs are as honestly designed to get people back on track as could be. In, say, the last five years as a manager, and in my organisation of a couple hundred engineers, there were exactly two cases (and the key point is that I recall both specifically) where a PIP was primarily motivated to document the already extremely obvious (to anyone far and wide) underperformance and attitude problem. And even then, the managers in question had the professionalism to design the PIP to be eminently achievable.
Generally speaking, I find the likelihood of a PIP to be adversarial and/or a tool to be able to fire somebody to be much more strongly connected to whether there has been an adversarial relationship between the employee and their manager. For that reason, I found that it paid off hugely to make sure people move to different teams & managers and get a reset there before taking any drastic action. In the same way as people are said to leave due to their managers, not jobs, it's key to take that personal component out of a bad situation.