How might they do that given that Microsoft now owns all of the IP and GitHub is mostly closed source? It seems like a very different situation than the liberally open source MySQL.
Anyone can make an image hosting site, making one profitable long term is always the problem. For now, GitHub is winning because of the free side of their toolset.
The infrastructure to store and deliver seamlessly zettabytes of video all around the world surely doesn't come cheaply.
Though Google is likely doing accounting shenanigans with cross-company billing and charges YouTube "just enough" for the datacenter/cloud access that, on paper, it's barely breaking even (if only for tax advantages). But I don't have proof of that.