“equity” or “retained earnings.” They can’t make dividends out of those profits to anyone.
We should probably stop using “nonprofit” as a term and call them “tax-exempt” or “charitable” organizations (like the IRS does).
The Church is wealthy because it makes a profit and invests it each year.