It's not a big mystery. Linus released a primitive kernel that worked, at the right time, with the right license, and then diligently kept rolling up contributions and releasing the result.
These days he writes very little code himself; almost all he does is manage patches. I'm not sure how much code he wrote in the early days, but I think his diligent application of patches sent to him helped Linux to become stable and useful.
He wrote huge parts of it himself and in 2006 about 2% was still written by himself. I can't find how many LOCs it had then, but it was 5 million in 2003 and 11 million in 2009 so 8 million-ish. That means in the ballpark of 160.000 lines of code over 15 years, along with managing the whole project. And when that's not enough, he bootstraps what's possibly the most widely used source control management system today.
Now I've met people who are absolutely brilliant, they're rare. I've met people who truly excels at making everybody pull in the same direction, they're rare too. But I've never met one that's both, he could have been overly possessive and not let anyone else work on his pet project. It's one thing to say you want contributions, it's another thing to mean it in practice. Or he could have been the one pointing out a direction with nobody to do the heavy lifting.
Most of us don't even want to do both, the more I have to rely on others to get something done the more I realize how much I'd hate it if everything I did was manage other people. Those who want to run the business/organization/project get out of the doer role quickly, those who don't avoid management and get into some kind of technical guru role, to use a military analogy more like the special forces than a general. If you find one that both can do both and want to do both, you've hit the jackpot.