Mozilla Foundation is purely a donation-fed nonprofit, and most things you associate with "Mozilla" are made by the Mozilla Foundation. In fact, even Firefox itself — the open source project — is made by the Mozilla Foundation.
Mozilla Corp is just a company that employs engineers to work on Firefox. (I.e. their job is to be ordinary FOSS contributors to the project.) Those engineers might have a profit motive to do things Mozilla Corp investors/shareholders like, but that's fine, because those engineers mostly aren't part of the Firefox steering committee. The Firefox steering committee (along with all other Mozilla projects) is composed of people who are employed by the nonprofit Mozilla Foundation; and/or FOSS people external to Mozilla as a whole.
(ETA: fixed the names. I originally called Mozilla Corp "Firefox Corp" — and it really basically is, as Mozilla Corp doesn't employ people to work on anything other than Firefox. IMHO "Firefox Corp" would be a strictly-better name for it.)