This is mostly just due to how nonprofits work. If you have excess revenue, you can’t return it to shareholders so you might as well spend it on mission-oriented activities.
You can do this up to a point but if it looks like you're actually making a profit it might raise questions eventually. Keeping enough to cover one year's operating costs is pretty common though.
Non-profits usually don't "compete" at least in the economic sense. They exist for a charitable purpose that isn't normally well-served by the competitive market.