I’ve always been told that HR is not there to help or protect the employee, it’s there to protect the organization.
It is true that HR is intended to manage risk (protect the organization), but talent acquisition and retention is also a big part of the job. Managing benefits and payroll is a lessor, but still important role HR plays. The overall attitude of how HR is managed actually comes from the CEO, who is the steward of corporate culture. In the case of Apple, this is Tim Cook. If HR practices prefer minorities over other qualified candidates, then the CEO is pushing that policy, or through inaction (in the case of a “bad” CEO), at least supporting the practices. A “good” CEO should be the driver of HR hiring practices and setting the high level litmus for talent acquisition. All the other minutiae is determined by the HR director. So, in short, look at the CEO and board of directors if you want to better understand the “why” in a company’s hiring practices.
I can tell you that the company I work for looks solely at the qualifications and attitude of the applicant and race/sexual orientation/ethnicity does not play into hiring determination. The side benefit of this is that our workplace is quite diverse naturally without trying to force it, however that is more a consequence of the area the business operates in rather than via artificial means.