This is the No. 1 trait of great leaders, says a Wharton professor who's studied thousands of executives

The world's greatest leaders have these traits in common

The less you care about your own success, the more successful you will be.

That's according to Adam Grant, organizational psychologist, top-rated professor at Wharton business school and author of The New York Times best-selling books "Give and Take," "Originals" and "Option B."

"One of the things that stands out for me when I think about what distinguishes the greatest leaders of our time, is that success is very rarely a goal for them, it's a byproduct of other goals that they have," Grant, who has studied thousands of leaders in his career, tells CNBC Make It.

"They say, 'Look, the most meaningful way to succeed is to help other people succeed, to advance a vision or an idea or a project that is bigger than me, that's going to affect a lot of people,'" explains Grant.

"And then the bigger you aim there, the more you focus on doing something that's going to benefit others, the more likely you are to produce something that's also going to achieve success for you."

Adam Grant speaks about "Option B," his new book written with Sheryl Sandberg, at a Commonwealth Club event in San Francisco.

A prime example is self-made billionaire Elon Musk.

He's the CEO of electric carmaker Tesla, which is aiming to accelerate the transition away from coal-based energy. He's trying to make it possible for humans to live on Mars with his space exploration company SpaceX. He's the co-founder and chairman of artificial intelligence research non-profit OpenAI, and in the last year, he started Neuralink to merge humans with machine interfaces. He's even taking on the mundane with The Boring Company to dig tunnels that will reduce the amount of time stuck in traffic.

Wharton Professor Adam Grant: Why Elon Musk wants his employees to always speak up

But according to Musk, it's not money or bragging rights that motivates him.

"The thing that drives me is that I want to be able to think about the future and feel good about that," says Musk, speaking to a group of governors gathered in July. "We are doing what we can to have the future be as good as possible, to be inspired by what is likely to happen and to look forward to the next day."

That kind of thinking — believing deeply in achieving an ambitious goal — is exactly what Grant says makes an individual achieve greatness.

How top tech entrepreneurs use regret as motivation to succeed

It also does wonders for team moral.

"Over the last dozen years I have worked with and studied literally thousands of leaders," says Grant. "The ones that I admire the most who also tend to produce the best results in their organizations are the ones who are givers not takers.

"When you track the evidence," explains Grant, "it tends to really work because leaders who put other people first, who have a bigger vision or ambition for the organization than just self glorification or fame or fortune, they end up inspiring a different kind of effort, a different level of motivation, a greater sense of belongingness," he says. "And I think that's something we can all aspire to."

See also:

Why Elon Musk encourages his employees to tell him exactly what he's doing wrong

The psychological trick that motivates Mark Cuban and Elon Musk to succeed

Wharton's No. 1 professor: 'Never give up is bad advice. Sometimes quitting is a virtue.'

Here's the best way to stay motivated at your job, according to Wharton's No. 1 professor