That may be how it works in a rather idealistic scenario, but in real life, things are different. Sometimes people use deception and make millions from selling dodgy products. Sometimes, whilst both parties may gain from a trade, one gains much more than another. Sometimes both parties gain, but there are externalities, so third parties lose out. Sometimes people do work that greatly benefits society, but the market fails to reward them for it.
My point, however, is that what the market gives people and what they morally deserve may be two very different things. That doesn’t mean we should abandon the market system. I’m just suggesting people shouldn’t justify a lack of generosity by claiming the market always rewards people exactly according to what they deserve — because it doesn’t!