HR-bashing has been one of the professional world’s most popular pastimes since well before the viral 2005 Fast Company article, “Why We Hate HR,” which summed it all up: The department is seen by many as “a dark bureaucratic force that blindly enforces nonsensical rules, resists creativity, and impedes constructive change.”

But for companies that are trying to change—whether to become better corporate citizens or simply more successful—a smart and flexible HR department is crucial. No matter how lofty the goals of a visionary founder or chief executive, it’s difficult for those goals to be achieved without the right people and the right support in place. As Patty McCord, a former chief talent officer at Netflix, told me:

You wouldn’t think of going to another country or doing a new initiative or changing the direction of the company without having a CFO in the room to be able to model what it is going to cost. You also shouldn’t be able to think about any of those things without having the person in the room that says, “Do we have the right people to pull that off?”

“Pulling that off” starts with what McCord calls “the muscle of every company”: recruiting. The wave of Baby Boomer retirements is already causing angst across industries: The Society for Human Resource Management reports that by next year one-third of the U.S. labor force will be over 50 years old, up from 27 percent in 2007. Michelin North America, the tire manufacturing company, told NPR that more than 40 percent of its workforce is approaching retirement age.

But given the interests and demands of the next generation to fill the corporate ranks, companies can’t simply replace what they lose. According to a Deloitte survey earlier this year, 47 percent of Millennials believe that the “purpose of business is to ‘improve society/protect the environment.’” Eighty-three percent of the 3,000 MBA students polled by the nonprofit Net Impact would take a 15 percent salary cut “for a job that makes a social or environmental difference in the world” (a positive difference, one would presume).

Bringing in those bright young people who will help a business change course for the better is a key role of human resources. But what can and should the role of HR be in driving positive change after staff show up?

First, get out of the way. Seemingly pointless processes and paperwork—this is the HR that drives people crazy. In some ways the best thing HR can do to enable change is, well, do less: Tom DiDonato, the head of human resources at Lear, an auto-parts manufacturer, did away with the longstanding practice of basing compensation on performance reviews, realizing that the emphasis on pay created stress and stifled the candor that people need to improve and innovate. Instead the company bases pay on market conditions, and awards equity and promotions for good performance. “We can take care of people and tell them they’re extraordinary through our actions,” he told me, “but not get hung up on a process that everybody hates.”

Next, help the company do good. I’m not talking about “employee engagement” programs that send staff out in matching T-shirts to paint a wall for five hours a year, which might be great for team-building but can be far more trouble than they’re worth for the host nonprofit. And I’m certainly not talking about appointing a happiness czar to set up foosball tables and a sushi bar. Rather, I mean channeling the company’s talent and resources to help both its bottom line and society at large.

Look at Eileen Fisher, the clothing company that recently launched its plan to improve the environmental and social sustainability of its entire supply chain, from cutting waste and chemical use to training supply chain workers in labor rights. Implementing such a comprehensive vision requires intensive cross-disciplinary cooperation; Amy Hall, the company’s director of social consciousness told me, that company leaders from design, manufacturing, production, and other functions meet weekly by phone and monthly in person.

Coordinating and cooperating across functions is difficult in any company, but Eileen Fisher has a famously collaborative culture: For example, instead of one CEO it has a “facilitating leader team” of seven executives. That culture is carefully nurtured by HR—or as they call it, “People and Culture.” Yvette Jarreau, Eileen Fisher’s director of leadership, learning, and development, told me that collaboration is “natural for us ... Traditionally work evolves into buckets or silos; we help connect people so they can break down the silos.” Hall told me that all of this means that “sustainability is no longer on the fringe of the company looking in, trying to influence wherever possible. It is now front and center, firmly planted in the strategic vision of the business.”

In addition to recruiting a diverse and sustainably-minded workforce and empowering them to do better, there is one more way that HR can drive change for the better, which may be the most compelling of all.

“Unconscious bias” is on the lips of many HR executives today, particularly in Silicon Valley, where the lack of diversity is particularly acute. Google developed a program to help employees notice their deeply-held perceptions and identify ways to counter them; Laszlo Bock, Google’s head of People Operations, told me: “After going through [the program], about 90 percent of Googlers not only know what bias looks like, but they tell us they feel an obligation when they spot it to step in and intervene.”

Google isn’t tackling prejudice out of altruism; as Bock told me, “We actually have very different conversations which then causes people to feel more safe, which causes them to perform better.” But if people are treating others more fairly in their dealings at work, one hopes that at least some of that spills over into their lives outside of the office.

Given this country’s racial and gender disparities, it is all too clear that every single part of society—companies and their HR departments included—must do everything they can to tackle injustice and inequality. Fighting bias, conscious or unconscious, might be the best thing that HR can do for any individual employee and company, and society more broadly.

Of course, there is one person in a company whose behavior is under constant scrutiny, in and outside of the office: the CEO. Which is where we will turn our attention to in the next installment of this series.