GitHub has 28 million public repos
Gitlab is has less than an order of magnitude as many Under a million in 2020, and nearly 80% without FOSS license.
Is it everyone’s favorite, or best, or most feature rich. Nah. Is it where the FOSS projects are. Yes.



Sure, self-hosting is a great option for very large projects, but a random python library to help with an analytics workflow isn’t going to self-host. Those projects, along with 27,999,990 others have chosen GitHub, often times explicitly to reduce the barrier to contribution.
Also, all of those examples are built on thousands of other FOSS projects, 99% of which aren’t self-hosting. This is the same as arguing only Amazon is a bookseller and ignoring the thousands of independent book publishers creating the books Amazon is selling.