Because Google pays Mozilla ~$500M dollars a year, nearly 80% of all of Mozilla's revenue, use Google as the default search provider.
https://www.bloomberg.com/news/newsletters/2023-05-05/why-go...
If Google turned off this money faucet, Mozilla would be severely impacted. Unfortunately as Firefox's market penetration gets lower, the value of that deal gets lower, should Google stop paying it and someone like Bing takes over.