As an independent entity, Github would have had to evolve in a very different way and gone more aggressively after making money, fixing their cost structure, like most of their competitors like Atlassian, Gitlab, and other companies selling developer tools as a SAAS service. So, even though these are comparable companies with comparable offerings, the value proposition is very different. There is no way in hell Gitlab is worth anywhere near what MS just paid for Github.
Being based in silicon valley means Github paid a premium for being there and burned through loads of cash paying for expensive developers, fancy office space, etc. Much cheaper if you are based elsewhere, have less emphasis on wanting to have every OSS project on your platform and more emphasis on selling tools to corporations. This is in a nutshell the strategy for Atlassian and Gitlab. Both also offer freemium layers for OSS but mostly their deal is upselling to their paid offerings. Growth that way is much slower. Though, I would say, Gitlab is now pretty well positioned to succeed where Github struggled.