They've used their $100-160 million (it has grown over time) budget for a lot of things in the last several years. Off the top of my head:
* Legal battles * Advocacy for open standards like HTML5 * Web literacy projects like webmaker and MDN * LetsEncrypt * Bugzilla * Thunderbird * NSS * Spidermonkey * Rust * PDF.js * Firefox OS * Development and support for open VR web standards * Supporting other, non-Mozilla open source projects like Tor and NTP
Remember that the goal isn't the success of any particular software product. It's pushing the debate and forcing other vendors to adopt and stick with OSS and open standards.
In short: yes, Firefox has lagged behind chrome in the last few years in terms of speed. But remember when IOS didn't support HTML5, or any competing apps? Remember when no one was serving the global south with mobile web capable devices? Remember when HTTPS adoption was at 3% and going nowhere? Remember when CSS meant days of per-browser testing and tweaks? You're welcome.