With Google money.
If Mozilla needs more money than that, they can tighten their belt by giving less of it to other projects[0], or refrain from building (apparently) non-competitive competitors to things that already exist[1]. Ads should be a last resort IMO.
[0]: https://news.ycombinator.com/item?id=41681666
[1]; https://news.ycombinator.com/item?id=50544738