An HR department absolutely works to protect the company, but a good HR department will also work to protect the employees, because in the long view that is also beneficial to the company. And many HR people who I've talked to specifically enjoy their jobs because they like working to make employees lives better. Where their directives conflict with that they will try to fight the directives.
Certainly in some cases where there is a unresolvable conflict between employee and employer, HR will work against the employee. But for a good HR department those situations should be very few. A good HR department will be able to project forward into a long enough view that they can find ways to move forward amicably that protect both the employee and the employer, to everyone's benefit.
So while for a single employee HR might seem like a waste of air, it's elementary for any business with a reasonable number of employees.