This isn't actually true for all companies.
At my (large) company HR only gets involved once a decision to hire has been made. They make sure the background check is performed, vet the offer to make sure it is within guidelines (or the guidelines have been waived by someone In Charge) and then handle the huge volume of paperwork that must be signed in order to formally accept the offer.
Following on-site interviews the hiring manager will collect and sanitize feedback from all the interviewers to give to the candidate. Sometimes the message is something generic, like "not a good fit" or "lacking required experience" because some feedback just can't be sanitized.
If the deficiency is in skills (technical or soft), rather than personality or demeanor, then we generally provide solid feedback. For a candidate that is borderline we will sometimes invite them back (or out for a drink) to ask them how they would address the perceived deficit if we were to hire them. Not only does it give them a chance to recover, it lets us see how they handle critical feedback.
I don't believe there is liability exposure here, unless someone were to refer to gender, race, religion, disability or ethnic background as a reason for not hiring. Since those are never the reason for not hiring, this isn't an issue.