Prior to going out on my own at a precociously young age, my time in corporate America (~3.5 years) was fairly brief, and less than half of it spent at companies large enough to have an HR apparatus in any meaningful sense.
I always found their seeming double-agent role confusing and ambiguous in a slightly sinister way, even as they preached that they were there for us workforce people if we needed anything.