I see this repeated often enough where it is presented like some nefarious plot. While I think it is nominally true, I think a better way to think about it is to think of what HR's incentives and motivations are, and to realize there are many areas where your interests do align with your employer's.
For example, a primary responsibility of HR is "keep the company from getting sued" when it comes to personnel matters. A really shitty HR department will interpret this as "sweep shit under the rug", but a good, competent HR department will handle things above board, according to established procedure. A good HR dept. does this not because they want to be nice, but they realize that the best long-term way to keep the company from being sued is to make sure complaints are handled above board.
In general, when evaluating how people will really act I think it's best to leave morality out of it, and instead realize where their incentives are coming from and try to align your goals with those incentives.
For example, a primary responsibility of HR is "keep the company from getting sued" when it comes to personnel matters. A really shitty HR department will interpret this as "sweep shit under the rug", but a good, competent HR department will handle things above board, according to established procedure. A good HR dept. does this not because they want to be nice, but they realize that the best long-term way to keep the company from being sued is to make sure complaints are handled above board.
In general, when evaluating how people will really act I think it's best to leave morality out of it, and instead realize where their incentives are coming from and try to align your goals with those incentives.