Mark Zuckerberg has a lot to celebrate. He survived congressional scrutiny and has faced down a series of Facebook privacy scandals. His most recent move, to restrict other companies' access to Facebook's data via its API, has caused havoc for many entrepreneurs. But it seems to have worked, at least as far as investors are concerned. The company's stock closed at a record high of $203.23 on Friday. That was enough for Zuckerberg to edge out Warren Buffett as the world's third richest person, after Jeff Bezos and Bill Gates.

Zuckerberg's net worth is now $81.6 billion, according to Bloomberg, while Buffett's is about $81.2 billion. Gates is worth about $92 billion, and Bezos is worth an astounding $140 billion. 

But there's another, more important reason that Zuckerberg is now worth more: Buffett has been doing a great job of giving his money away, something that he, Zuckerberg, Gates, and most of the world's most well-known billionaires have pledged to do. Buffett has given Berkshire Hathaway stock now worth more than $50 billion to the Bill & Melinda Gates Foundation alone.

When it comes to giving, Zuckerberg and his wife, Priscilla Chan, have a lot of catching up to do. They appear to have devoted well under $10 billion so far to philanthropy. Some of that has gone to the Chan Zuckerberg Initiative (CZI), which is not a foundation or even a nonprofit, although it has a nonprofit arm. Instead, it's a limited liability company. The purpose of this structure seems to be to allow Chan and Zuckerberg to use their money either for charitable donations or to fund for-profit organizations and startups that fulfill a charitable goal. For example, it led the Series B funding for Andela, a startup that trains software developers in Africa. There's no question that providing coding education to people in the world's poorest regions will make the world a better place. But if Andela proves a huge success, CZI could wind up raking in big profits.

Presumably, Chan and Zuckerberg will be doing a lot more giving in the future. Three years ago, they pledged to give away 99 percent of their net worth during their lifetimes and have pledged that money to CZI. At Facebook's current stock price, they have at least $70 billion to go. On the other hand, Zuckerberg is more than 50 years younger than Buffett, so they likely have a lot more time in which to do their giving.

Bill and Melinda Gates, for their part, have given over $45 billion to the foundation that bears their names. (Warren Buffett is a big donor as well.) But what about Bezos? The Amazon founder displayed very little interest in philanthropy until last year, when he became the world's richest man. At the time, The New York Times asked him point blank if he had any plans for giving, and he tweeted out the question of where he should donate. He got thousands of responses. Even so, his donations so far seem to total less than $100 million, and the biggest--to a college fund for "Dreamers," illegal immigrants who arrived in the U.S. as children--seems as much a political statement as a grant.

In the competition to be the world's richest person, Bezos is well ahead of the pack, with about $50 billion more than Gates, his nearest competitor. But in the competition to be the world's biggest giver, he's getting left in the dust.