The key to this question is to understand the difference in underlying motivations. For-profit companies look for opportunities where they can get a financial return on their investment. So they make gadget X for half what they sell it to customer Y. This is great, and most of the world works this way.
But – there have always been people/groups/causes/issu
This is where nonprofits come in. They establish themselves with the goal to meet a tangible need instead of the goal to make money by meeting that need. This distinction allows they to not only make their revenue from sales like a normal business, but also to get donations/grants to compliment them. This allows a lot of great things to happen in our world that would otherwise be left undone.