I'm not sure how well know this is, but besides their contract with Google to be the default search option, Firefox does earn money through revenue share with all other default search options. A normal healthy company would just rely on those. Growing the user base would therefore grow the amount of rev-share income. So improving the product by itself, and thus attracting users, does make money - and probably enough to run Firefox and Mozilla. Just not enough to pay their CEO.