This is just organizational structure. "For-profit" doesn't mean "profitable". Also, the organization is "wholly owned" by a non-profit, so if there are profits declared in the form of dividends, those dividends are sent to the non-profit.

Note that many non-profits have exceptionally high-paid executives and "contractors".

Regulatory requirements on non-profit organizations are very high, and those organizations are, in fact, very limited in what they can do and how they receive their money. There are very good reasons for a non-profit to own for-profit entities, and, similarly, for philanthropic organizations to organize as for-profit entities.