This is a difficult question for me to answer because my practical sense tells me the answer is capitalism, but you ask for the "ideal" form. In that case it has to be socialism. Summarized briefly as "from each according to his abilities; to each according to his need(s)" (Karl Marx), what could be more ideal: each of us works up to his ability, and each of us takes from the common "pot" what he/she needs.
The only problem with this idea is that it doesn't seem to work; it's been tried many times by people of good will, with no long term success. The people that work hard seem to realize that they don't have to work hard because it creates no particular advantage for them, and they lose their main incentive to work; after all, if you can get what you need and do nothing, why work?
So the "ideal" isn't really that great. If I could paraphrase William James: what do you call a good idea that doesn't work? A BAD idea.