While a meme, yes. I'm an ex-boss and I'll happily verify that HR works for the company. The function is, "within what the company needs, keep employees happy and content", sure - but at the slightest conflict between company needs and HR needs it's the company needs that matter.
This isn't really supposed to be a secret, but I think we don't talk about it openly enough since every time a discussion like this pops up I see people who have misunderstood the function of HR.
... now what might be a bit more of a secret is how closely companies work together with the unions. Let's just say I've never seen any real union pushback.