The Gates Foundation is transforming the lives of billions of people—but it wouldn’t be the force it has become without the distinctive visions of the couple behind it.

It was March 2018, and once more Bill Gates found himself behind a podium. In the previous few months, he had given one keynote address after another—in San Francisco, he’d urged drugmakers to focus on diseases that affect the poor as well as the rich; in Andhra Pradesh, India, he had preached the value of smallholder farms; in Abu Dhabi, he’d enjoined the Crown Prince and other princelings to continue their financial support for global health initiatives; in Cleveland, he’d promoted investment in better schools.

Now the world’s second-richest man and foremost itinerant advocate for the poor was in Abuja, Nigeria, talking about the same theme that had underlain all of these speeches: the need to invest in “human capital.” Among those gathered at the conference center, in the shadow of the Aso Rock Presidential Villa, was the Nigerian President himself, Muhammadu Buhari, and what seemed like the entire seat of government, from legislative mandarins to a full house of governors and business leaders—all primed to hear from a man who had, so far, lavished the country with $1.6 billion in grants through his eponymous foundation.

Two months earlier, the Bill & Melinda Gates Foundation had taken the unusual step of absorbing a $76 million IOU Nigeria owed to Japan, for money Nigeria had borrowed to fund a polio eradication effort. The progress there had been striking. In 2012 the country had more than half of the worldwide cases of this paralyzing disease; that number had since been cut to zero.

But Gates wasn’t there to deliver a keep-up-the-good-work speech. He was there to say the opposite: to tell his hosts that their nation—Africa’s richest and most populous, with 190 million residents—was on a knife’s edge. The country was facing an “epidemic of chronic malnutrition,” with one in three Nigerian children chronically malnourished, Gates told his audience. Nigeria had the fourth-worst maternal mortality rate on the planet, making it “one of the most dangerous places in the world to give birth.” More than half of rural Nigerian children could not adequately read or write. The primary health care system was “broken.”

The harsh litany went on. On the basis of per capita GDP, oil-rich Nigeria was “rapidly approaching upper-middle-income status, like Brazil, China, and Mexico,” Gates said. But by every meaningful measure, it still resembled an impoverished nation: Life expectancy was a meager 53 years—nine years lower, on average, than its low-income neighbors in sub-Saharan Africa. Nigeria was headed for a perilous future—unless it changed course, that is, and began to substantially invest in the health, education, and economic opportunity of its people.

“It may not be polite to speak so bluntly when you’ve always been so gracious to me,” Gates told the gathering, veering a bit from his prepared remarks. But, he explained, he was “applying a lesson” he’d learned from Nigerian businessman and fellow billionaire Aliko Dangote, who told him: “ ‘I didn’t get successful by pretending to sell bags of cement I didn’t have.’ I took from that, that while it may be easier to be polite, it’s important to face facts so that you can make progress.”

It was a speech that “rattled” the government, according to the next day’s headlines. And it could have been given only by Bill Gates, says Ngozi Okonjo-Iweala, chair of GAVI, the international vaccine alliance, who twice served as Nigeria’s finance minister. Years earlier, when Gates was CEO of Microsoft, the company he cofounded with Paul Allen in 1975, he’d had no trouble speaking bluntly to government leaders—vigorously challenging, for one notable example, the U.S. government’s antitrust case against the company during the 1990s.

The post-Microsoft Gates was still unabashedly candid—“He did that in Nigeria, and he didn’t mince words,” says Okonjo-Iweala—but the frankness was now infused with something else: a driving sense of purpose. A more tender kind of, well, passion.

That’s a word that’s used quite a bit these days to describe Bill Gates, 63, who in the waning decades of the 20th century was often pilloried as a brash—and sometimes soulless—corporate predator.

In Dhaka, Bangladesh, the government went all out to welcome the Gateses, recalls a friend. The couple just wanted to spend time listening to the people.Courtesy of Bill & Melinda Gates Foundation/Prashant Panijar

Courtesy of Bill & Melinda Gates Foundation/Prashant Panijar

Ray Chambers, an influential American philanthropist who is now the World Health Organization’s Ambassador for Global Strategy and who for several years served as a UN Secretary-General’s Special Envoy for Malaria, says Gates’ “passion for the subject”—whatever that might be in global health—“and his compassion for the victim” are equally striking. Physician Helene Gayle, who spent five years with the Gates Foundation, overseeing its HIV, TB, and reproductive health programs and who is now CEO of The Chicago Community Trust, singles out the word “determined” before saying, “that’s not quite right—that’s too pedestrian. It’s somewhere between determined and passionate. I mean this guy is on a mission, and he is—the word is ‘undeterred.’ ”

And if you’re wondering what drives this perpetually refueling zeal, a big part of the answer can be found on the other side of the ampersand in his foundation’s name: ­Melinda Gates.

If Bill’s superpower is speaking truth to the mighty, Melinda’s may well be hearing the truth of the unmighty—and then internalizing and sharing that secret, often brutally repressed wisdom. For a generally soft-toned speaker, her voice has the command of a church bell. But those who know her say her truly uncanny talent is simply the ability to listen.

Gayle recalls one trip with Melinda, now 54, and Bill in the early 2000s to India, meeting with a group that was particularly hard-hit by HIV, women in the commercial sex industry. Melinda—as was often the case—sat on the floor with the women and listened. “Many of them were despised and stigmatized in their own communities,” recalls Gayle, “and having her listen to these women’s stories and hear the lives that they led—why they ended up having to trade sex for basically survival, and what it meant to them to have people from outside come and listen to them, listen to their stories, be willing to hug and embrace them, and treat them like human beings with equal value—was a very, very moving moment,” she says.

In Mozambique, it was the same. The ­Gateses would travel to a remote rural area, talking with women about their desires for their children—“and their fears that they wouldn’t be able to provide for their children and care for them,” says Gayle. “And Melinda would sit on the ground, talking woman to woman about the things that mothers care about. She has this remarkable ability to connect with everybody.”

Raj Shah, the CEO of the Rockefeller Foundation, has likewise worked at the Gates Foundation and traveled frequently with its founders, but there is one trip that stands out: Bangladesh, December 2005. The government had pulled out all the stops in welcoming the famous couple to Dhaka, putting their giant faces on billboards lining the highway from the airport. The Gateses, however, just wanted to visit the famous International Center on Diarrheal Disease Research—or, as everyone called it, the “Cholera Hospital.”

Established in the 1960s, the hospital had long been a pinnacle of research on ways to help children with diarrhea survive. “At the time,” recalls Shah, “there was a cholera outbreak, and we were walking through. And I don’t know if you’ve ever seen a cholera cot, but basically it’s a raised cot with a hole in the middle, and they have a blue tarp over it, for obvious reasons.” On each cot was a child. “And the kids just have constant diarrhea,” says Shah. “There are buckets under the cot to capture all that. And the mothers sit next to their kids and constantly give them a combination of oral rehydration, salts mixed with purified water and some other electrolytes.” That ORS, as it’s called, keeps the child from dehydrating and dying during the diarrheal episode.

Melinda sat down beside one mother and began helping to spoon-feed her child, as the two women—one born in Dhaka; the other, in a middle-class home in Dallas—talked through a translator about what they ate for dinner. It was a moment when Shah realized that Melinda could bond with anyone. He pauses for a moment in the conversation: “I could be wrong in all my recollections. But I just remember her saying that ‘Oh, my family ate rice and beans also!’ It’s just who she is: People connect with her in a very special way.”

For evidence of what happens when an unstoppable force meets a profoundly movable human being, one has simply to measure the impact of the Bill & Melinda Gates Foundation.

From January 1995 through the end of 2017, their namesake philanthropy (along with earlier Gates family foundations that were merged into the Bill & Melinda Gates Foundation in 2000) has deployed an extraordinary, barely countable $45.5 billion. (When I asked the foundation, partly as a hypothetical, if they could send me an accounting of every single grant they’d doled out since inception, I got back a spreadsheet with 41,487 line items.)

That $45 billion has launched, and then continually supported, what global health experts widely acknowledge to be two of the most successful international, private-public partnerships ever formed. The first is the aforementioned GAVI, which has helped developing countries immunize 700 million children against preventable diseases. The second is The Global Fund to Fight AIDS, Tuberculosis and Malaria. The fund, through its own community partnerships, has put more than 17 million people on retroviral therapy for HIV, cared for 5 million people with TB, and treated more than 100 million cases of malaria in 2017 alone—even as it helped prevent an untold number of infections in all three diseases. (Apart from national governments, the foundation is also the largest donor to the World Health Organization.)

The Gates money, put to work through the Global Polio Eradication Initiative, has helped bring that horrific paralyzing disease to the brink of elimination, leaving only two places on the earth, Afghanistan and Pakistan, where the wild poliovirus remains active. In 1988, the disease could be found in 125 countries.

The eradication quest is, as nearly all foundation efforts are, sophisticated and data-driven. Gates-funded disease hunters have plumbed sewage systems in hotspot regions to check for lurking poliovirus and used digital satellite data to understand how many kids were in a given area—and, therefore, how many houses inoculation teams needed to visit.

The foundation has spent more than a billion dollars to date to reduce the burden of ancient, and long neglected, tropical diseases (NTDs) that can cause everything from blindness to anemia to an elephantine swelling of limbs—and that, despite the progress made, continue to debilitate one-seventh of the earth’s population. It has fortified health systems in developing countries and brought new innovations to agriculture. (As Bill begins one of his wonkily upbeat GatesNotes blogs, “I’ve never been shy about my passion for fertilizer.”)

The foundation jump-started a national conversation in the U.S. on education reform: one backed by data, as well as dollars—though there have been many of those, too. (It spends $300 million annually on K-12 learning, and on learning about learning.) The Gateses have even changed the nature and scale of family philanthropy—partnering with Warren Buffett in 2010 to convince other billionaires to give half or more of their money away during their lifetime or in their will. Today, nearly 200 families have joined the aptly named “Giving Pledge.”

“Every one of their actions has a multiplier effect,” says Warren Buffett in a phone interview about the pair, with whom he has been close friends for decades. His own fortune became part of that multiplication as well, when he donated 500,000 Berkshire Hathaway B shares to the Gates Foundation—a gift then worth about $1.6 billion.

“Every one of their actions has a multiplier effect. They act with a unity of purpose.” – Warren Buffett, Chairman and CEO, Berkshire Hathaway

But the impact of Bill and Melinda Gates is due to more than money. Buffett returns to his earlier thought: “The two of them have a multiplier effect—the two of them together. They act with a unity of purpose and with a difference of style,” he says, chuckling at the truth of his own line: “That just came to me—and it’s really true.”

“They are so results-orientated that most people have no idea all the things that would not be happening without them,” says Bono, who, like the Gateses, has been a tireless champion for global health, and whose own (RED) and ONE campaigns have received funding from the couple. “For as long as I’ve known them, their only interest in their income is the outcomes it can generate for others in terms of changing lives,” he adds. “They don’t ask for acknowledgment; they just get on with it. They set up the scene, hire the photographer, but are so focused on results, they sometimes forget to be in their own photograph.”

Their work over the past 20 years has helped transform the lives of hundreds of millions of people—and will surely affect billions more if the research they’re funding now helps prevent and cure AIDS, multidrug-resistant TB, malaria, neglected tropical diseases, and the flu. It will help immeasurably more if the work they’re doing now to empower women, provide sanitation, boost agriculture, and improve education (as well access to education) comes to full fruition.

For all that, Fortune has chosen Bill and Melinda Gates as our 2019 World’s Greatest Leader. The pick, pointedly, is a singular one; the power of their leadership is definitely double-barreled.

To understand how the Gateses lead, it helps to think of toilets.

This is just a guess, mind you, but it’s likely that there are few people on the planet who get more excited talking about commodes than Bill Gates does. In a world where as many as 4.5 billion don’t have “safely managed sanitation,” according to the World Health Organization—and of whom nearly 900 million (mostly rural) people still defecate in the open—a safe, affordable, self-contained waste treatment apparatus that requires neither running water nor sewers is the sine qua non of public health interventions.

To make the point, Bill again took to the podium, flying to Beijing this past November for the Reinvented Toilet Expo. Next to him, for their shared keynote—and resting on its own, shorter podium—was a jar of human excrement. “This small amount of feces,” said Gates, “could contain as many as 200 trillion rotavirus cells, 20 billion shigella bacteria, and 100,000 parasitic worm eggs.”

Despite the laughter in the audience, the container was filled with deadly stuff: In much of the developing world, in fact, it is a weapon of mass destruction, as proven by history’s seemingly unbroken epidemics of cholera, typhoid, dysentery, hepatitis, and diarrheal disease.

The toilet expo showcased a number of ingenious prototypes—the “most significant advances in sanitation in nearly 200 years,” Bill called them—and the Gates Foundation has put some $200 million into the effort so far.

But as Bill and Melinda explained in a joint interview in Seattle in late March, the reinvented commodes represented something potentially more liberating still. The toilets were a direct link to girls’ and women’s health and, ultimately, their economic empowerment. In sub-Saharan Africa, one in 10 school-age girls don’t go to school during their menstrual period, according to UNICEF, and many drop out after menstruation begins. “Think about what it’s like for a child to miss five or six days and how far behind they get,” says Melinda. Sometimes it is the threat of violence that keeps a woman or a girl from a public latrine—and because it’s usually women who take their children to the bathroom, that has a cascading effect.

In The Moment of Lift, which debuted in April, Melinda Gates shares stories that capture the interplay between gender, global health, and opportunity.

“We have to draw the line” between all of these connecting data points, she says. “Because if people don’t draw the lines—if we just talk about the importance of sanitation in terms of people’s health,” we fail to fully comprehend the missed opportunities and challenges. “What we’ve learned in our work is that you have to talk about the gender pieces, too, because they are specific.”

Indeed, as Melinda discovered in her two-decade journey through the developing world, for virtually everything that tends to limit human capital, there is a line connecting it to gender in some way. The boldest of these lines, certainly, concern the rights of women to decide if and when they get married, and if and when they have children. Both of these choices, in much of the world, have been taken away from women, with devastating and transgenerational consequence.

Melinda, a practicing Catholic who attended an all-girls Catholic high school in Dallas (where she graduated as valedictorian), has met resistance from some quarters on some of her family planning efforts, which involve offering women access to contraception. But as Geeta Rao Gupta, a senior fellow at the UN Foundation in Washington, D.C., explains, the Gates Foundation stance on family planning has been, as with everything else it does, about “meeting unmet need.”

The effort isn’t about telling women in the developing world to have fewer kids, says Rao Gupta: “It’s that women want to control their fertility. They’re asking for contraception. They don’t want this many children or too many children, and they don’t have the ability, the tools that are available to the world, to be able to make that choice.”

Filling that gap is not just about understanding social, cultural, or religious barriers, as important as they are. “What Melinda found was that there were supply barriers and logistical barriers in getting contraceptives into the hands of women. So then even when societies were open to that idea, there were challenges,” says Rao Gupta, who also founded the 3D Program for Girls and Women, which focuses on economic empowerment.

There were other gender lines, too—like those connecting birth choices to education, and then to child mortality. When it comes to the survival of kids under 5 years old, says Gates Foundation CEO Sue Desmond-­Hellmann, who is both a physician scientist and former chancellor of the University of California, San Francisco, “one of the best determinants of a child’s health is the educational status of the mom.”

In Manhiça, Mozambique in 2003. “Melinda would sit on the ground, talking woman to woman about the things that mothers care about,” recalls one ally who joined the trip. “She has this remarkable ability to connect.”Courtesy of Bill & Melinda Gates Foundation/Barbara Kinney

Courtesy of Bill & Melinda Gates Foundation/Barbara Kinney

“And so when you invest in education for both boys and girls, which most of the world happily does now, you’re investing in the future of those women as mothers—and in the health of their children.”

Melinda, who earned a bachelor’s degree in computer science from Duke University and an MBA from Duke’s Fuqua School—and who spent the next nine years at Microsoft—has carefully studied the data on gender-based barriers. And the data that wasn’t already available, she has commissioned through her foundation. But mostly she has learned through in-person absorption—through a kind of human osmosis: from listening to women in self-help groups in India; from talking to girls and mothers everywhere from Bangladesh to Indonesia. The insights came when she and her then 17-year-old daughter Jenn spent the night in the “goat hut” of a Maasai couple in the Tanzanian village of Mbuyuni, as they did in her homestay with son Rory in Malawi.

“It’s not at all where we started as a foundation,” Melinda says. “But I would say in the last six, seven years, we’ve really started to talk about this gender piece and have put specific investments down to make sure we address it.”

The complex interplay between gender and global health and opportunity is also the subject of Melinda’s book, The Moment of Lift, which debuted in April. The stories within are often raw and moving.

But the real theme of the book—as it is with all things Gates, it seems—is optimism: what Bill and Melinda see as the endless opportunities to fix what’s dragging us down and to “summon the moment of lift for human beings,” as Melinda writes in her book.

“The enormously impressive thing is that Bill and Melinda both bring a kind of infectious optimism that these are problems that can be solved,” says Peter Sands, the former CEO of Standard Chartered who is now executive director of The Global Fund. “Humanity has enormous capacity to innovate and think through and find ways of doing things. And when you spend any time with them, they’re constantly in the mode of saying, ‘What do we do next?’ And I think that’s a fantastically catalytic and inspiring turn to have.”

Both Gateses acknowledge how central this bright-side view is to the mission—and seem to wield it in nearly every public speech and presentation. “Optimism is fundamental to our work,” Melinda tells me in our March interview in Seattle. “We have to be able to see the reality of what’s going on in the world, and to know that and to listen to that. But we have to believe in the world getting better. And we do believe in the world getting better because it is getting better.”

“Bill and Melinda both bring a kind of infectious optimism that these are problems that can be solved.” – Peter Sands, The Global Fund

A child born today is half as likely to die before the age of 5, compared to a child born in the year 2000, she says. The poorest parts of the world are less poor than they were. “And we have to hold that belief in progress and help others hold that belief so they’ll come along on the journey with us. Because look, the journey we’re on is not a solo journey. Many, many, many partners need to be at the table to create, for instance, a new vaccine or a new technology that’ll benefit everybody.”

Bill chimes in, “I’d say that kind of optimism is particularly important now where there’s a kind of turning inward [politically speaking], and the trust in various institutions is down a lot.

“A lot of the things we do take a long time,” he says. “I mean, we’ve been working on an HIV vaccine for over 15 years, and it’ll probably be 10 more years before we get there—so 25 years in total. Malaria eradication, if things go well, is 20 years away. The polio effort started in 1988; we didn’t get engaged until 2000. You know, it’s a long journey.” That’s challenging, he says, when it comes to getting people to commit—especially when the initial impact of the effort, as in malaria reduction, is far away from many of the donors’ front yards. “Optimism,” he says, “is a key part of it to engage people.”

“Yes, we have to believe in what’s possible,” adds Melinda. “It’s not at all a naive optimism. It’s a realistic optimism. We’re trying to envision the future—as leaders envision the future of where their company or their mission will go. And for us it’s a mission that all lives have equal value.”

The argument for optimism has some awfully good evidence in Rwanda. A quarter-century after a genocide tore the already poor East African country apart, Rwanda is a case study in what’s possible. Led by physician Agnes ­Binagwaho, the nation’s former health minister, and others, Rwanda has steadily invested in health infrastructure, primary care, massive childhood vaccination, and maternal health.

Groups like the Gates Foundation, GAVI, The Global Fund, and Partners in Health—cofounded by Paul Farmer, who lived in Rwanda for years—have financed the effort substantially. But much of the innovation and footwork has been homegrown. Child mortality, meanwhile, has dropped from one of the highest rates in sub-Saharan Africa to one of the lowest.

The turnaround is so extraordinary that Farmer, a Harvard professor of global health and social medicine and a celebrated pioneer in treating tuberculosis, has launched an academic center to study it: the University of Global Health Equity. (Binagwaho has been named vice chancellor.

“We see it in lots of places: real examples of governments making investments—working with UN agencies, with NGOs, with others, but really driving their own future by investing in their young people,” says Desmond-Hellmann. “It’s happening not just in Rwanda, but also in Ethiopia, Bangladesh, and elsewhere.”

“We have to be able to see the reality of what’s going on in the world … But we [also] have to believe in the world getting better.” – Melinda Gates

But it’s work that has to be sustained, say the Gateses—and virtually every other global health expert. The sobering truth is that Rwanda, like Nigeria, is on a knife’s edge: If efforts to combat malaria, TB, AIDS, and tropical diseases slow or even remain static, the cases of disease don’t stabilize, they go up. And the next generation of kids loses ground.

It’s why the Gateses are so focused now on replenishing contributions for The Global Fund, a triennial fundraising push that takes place in October—and the financial refueling of GAVI after that. These two institutions are the outstretched limbs of the Gates Foundation, and the couple have spent more of their philanthropic dollars supporting health delivery programs like these than anything else.

“They could have elected to do anything with their lives,” says Warren Buffett, “and both of them are not only spending money but huge amounts of their time and energy around the world to make life better for people. Think about that.”

Correction, April 18, 2019: An earlier version of this article misstated a statistic about the prevalence of polio. It could be found in 125 countries in 1988, not 1998.

This article is part of the World’s 50 Greatest Leaders feature, our annual list of world-changing leaders in business, government, philanthropy, and beyond. Click here to see the entire package.