There are a lot of downsides to self-hosting your git as well. Especially if you need to deal with high availability, scalability beyond a single server, and/or being open to the public Internet.
I'm not saying you should never self-host your git server, but it's not for everyone.
Good thing Github suck at availability and scalability much more than your friendly local sysadmin...
These days even without trying I get more nine than GitHub.
Arguments against self hosting have to change as our SaaS overlords are decaying in front of our very eyes.
[dead]
No, these things are actually much easier to solve when you don't have to care for millions of users across every timezone and can just focus on <10,000 users that can easily be handled with a modest VPS setup.
It's truly pathetic how developers today cede everything to cloud services. A $20 VPS (whatever gets you 4 gigs of ram) is likely enough to host all the business needs of 90% of SMBs across the US.
Even easier today with things like Docker, Forgejo, and other great self hosting solutions.
Why would a company care about opening up their codebase to the internet? These are problems you don't have to care about when you only want a small subset of solutions. Especially when the tradeoffs are drastically simpler.