You can see how they roughly spend their revenue here [1]. Although it might be out of date now, it does highlight how expensive browser development really is at that scale.
[1] https://frankhecker.com/2020/08/15/how-mozilla-makes-money-a...
[1] https://frankhecker.com/2020/08/15/how-mozilla-makes-money-a...