Mozilla, as we know it, is a non-profit organization. So, it goes without saying that the company has to look for alternate ways to stay profitable and survive in the market. One of the ways to keep going for most web companies is to display ads, and mozilla is not new to this.
All of Mozilla’s previous attempts to bring in some revenue and keep Firefox
Firefox Suggest Stuffing Ads
The company claims that it will show ads only from partners who meet its privacy