It doesn't "fund" it - it buys its position as the default search engine in Firefox, which makes up the bulk of Mozilla's income. In this theoretical world where Google actually goes away, presumably some other company would want to pay for that position.