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...