My experience is that they usually warn you at your mid-year, so when they PIP you they have it documented that they "warned you" and you did not improve after the warning. But this is not always the case. One time I was blindsided after a good mid-year because my manager retired and was no longer "protected". Another time I was "warned" and then had weekly meetings with my manager so I could "improve". But it was a done deal when I was warned, and the weekly meetings were completely bogus. Once they warn you, the only way out is if someone else really screws up, and they PIP him instead of you to make the quota.
I did manage to wiggle out of a PIP warning once by formally documenting all the great things I did that year, so instead of PIPing me, they PIPed my boss.
I went 35 years with great reviews, and my trouble started when my hair turned grey. I wiggled out the first time, but they got me the next year. I was "excused" the next year. Then I changed jobs, and my new senior manager (good guy who hated PIPs) warned me when I was hired that I was fresh meat in the department, and there was a good chance that I would be PIPed my first year in the PIP rotation. And I was.