Part of the issue is that they historically were a mercurial hosting shop, so it's not like they were a direct replacement for Github. It was only in the last year or so that they added git support.
It's almost precisely a year since they introduced Git support. That's cool.
Part of the history to remember is that Mercurial and Git started at about the same time and on almost equal footing. GitHub was frequently cited at the time as a reason to use git. As in, "yeah git has kind of a crappy interface, but look at how big that community is!" The GitHub team really grabbed the momentum and never let it go. Now git is so common that supporting it is basically mandatory.
But it didn't have to end up that way. In a counterfactual history where the positions were reversed and HgHub and Gitbucket were founded, I think that HgHub would have dominated through a better focus on acquiring a community.
Github may have been part of the reason, but the support of Linus/kernel devs plus the very active mailing list probably had a lot to do too. I knew people that were git fanatics prior to github. Git was also the vcs of choice for Ruby / Rails developers.