I think it's like any social network. It grows in value with how many people use it. Yes, you can host your own public git repo or even your own gitlab, but then there's a barrier of entry to contribute to your code, and it's a lot harder for others to discover it.
The network grows in value with the size of the protocol, not just with a platform. Social networks can and should operate like email, not like siloed platforms. All the value ends up being captured and controlled by one single entity.
(I will not get in a tangent about web3, but that is the one thing that web3 skeptics always fail to acknowledge is how the current web is broken in that regard. We were promised open protocols, and we end up with a handful of companies building their own walled gardens)
The only way that Github would get any modicum of credibility would be if they joined the effort from codeberg/forgefed and integrated with activitypub. As it is now, github will be nothing but a mirror for my repositories that I will be hosting on gitlab and/or my own gitea.
Familiarity with the UX and conventions on that platform. Almost everyone knows how to make a PR against a GitHub repo. But some random other code hosting site? It would be a lot less familiar, and people would have to spend time making an account and figuring out how to contribute.
Even low barriers of entry can cause a big drop in user engagement.
disclosure: I work for github