In the USA there are several nonprofit entities recognized under IRC 501(C). Under that, the only true nonprofit are the 501(C)(3) organizations. Those are such things as churches, certain hospitals, Red Cross, and all way down to very small organizations like a local public food kitchen for the needy. So, even though they are "nonprofit" that doesn't mean that don't have a means to pay for something they should be. Mostly, nonprofits benefit from being exempt from certain tax programs like corporate income tax and certain sales taxes. In the USA, nonprofit organizations are corporations that have been granted nonprofit status by the Internal Revenue Service. They are exempt from certain taxes as long as their income is within their related business income. Unrelated business income is subject to corporate income tax.
So, in a nutshell, nonprofits are just corporations with certain tax benefits.