They are still able to actually make a profit (and quite often will, because careful balancing of perfect profit and loss is almost impossible and loss is bad), and I thought those profits were still taxed because otherwise that's too obvious as a tax dodge, it's just that profit isn't their main goal?
The parent comment is making a common mistake that non-profits can not make profits, that is false. Non-profits can't distribute their profits to their owners and they lack a profit motive, but they absolutely can and do make a profit.
This site points out common misconceptions about non-profits, and in fact the biggest misconception that it lists at the top is that non-profits can't make a profit:
https://www.councilofnonprofits.org/about-americas-nonprofit...
There is a difference between positive cash flow and profit as profit has differences in accounting rules. If you invest in some asset (let's say a taxi car) today, all of that cash flow will happen today. But there will be no effect on the profit today, as your wealth is considered to have just changed form, from cash into an asset. For the purposes of profit/loss, the cost instead happens over the years as that asset depreciates. This is so that the depreciation of the asset can be compared to the income it is generating (wear and tear on car vs ride fare - gas).
That would mean that any publicly traded company that didn't issue a dividend didn't make a profit which no one believes.
Do you really want to claim that Google has never made any profit?
In the case of many/most (honest) non-profits, the operating costs are paid out of a combination of the dividends of an invested principal (endowment, having been previously donated by donors) and grants/current donations. Any operating profit could then be returned to the endowment, allowing the organization to maintain higher operating costs indefinitely, thus giving the organization more capacity to further their mission.
For a business, revenue minus expenses in a given accounting period is considered profit. The only question is whether it gets treated as corporate profit or personal income.