I know this is a typical meme, but to be fair,
In the 6 companies I've worked in so far, I never saw the case of HR pretending to be anyone's friend in order to screw you.
It was always clear HR is there to enforce procedures and legal compliance, occasionally organize trainings, and not much more than that.