What alternatives do people have to monetize software in a more ethical way?

I particularly don’t understand the funding that some software receive. What they have to grant to receive those funds?

I also search for some type of monetization “model” better than donations, but more ethical than ads.

If it’s too much to explain I would be grateful for terms or books that I could search later.