Just like GMail is bringing them money. Initially it’s not obvious but then you realize because of it they dominate the search market and have a service which most people use to lock themselves in. That then extends to Android, etc.
Gmail makes sense as money maker. Running email at the scale they do is really cheap and they can run ads against it.
One YouTube video probably uses as much bandwidth as a month’s worth of a typical account’s usage.
That’s my point, GMail made no sense initially. All the other email services had free tiers with bunch of ads or you could get GMail for free. Everyone wondered how this pays off for Google, but in enough time it becomes obvious.
Google is no stranger to killing their own services. The fact they are not killing YouTube means it holds value even if it’s losing money.
Gmail made sense for Google when it was released. No one questioned it as there were already several other players in the market. The only real selling point at that time was Google offering 1 GB of storage for free with ads while other services were offering less. That other services switched to meet Google’s number rather quickly was more a sign that Google priced storage per user better at the time while other services had kept their legacy storage allowances.