Well, they don't typically charge for their services, which is largely why they're tax exempt. The money they collect is from volunteer donations (which aren't traditionally taxed), and workers seldom get paid for their efforts.
The modern age has opened up a lot of grey areas, though.
A lot of volunteer organizations - religious or not - sell various "fundraising" items. Sweaters and items with the organization logo plastered all over it, for example. Megachurches might sell sermons on DVDs. And while surplus money from those sales may be funneled into various charity programs, it also allows non-profits to operate what's essentially a retail industry within their greater organization. It's a hidden corporation, if you will. Think of how Susan G. Komen gets plastered on everything, and how much money they're pumping into that retail operation.
Likewise, while the average volunteer might go unpaid, various organizations are run by CEOs who now get paid millions of dollars.
Never underestimate a person's ability to pounce on loopholes.