But in hunter-gatherer culture, one must work or starve. Nature is unforgiving, and one's community may be no less forgiving to the persistent shirker.
Or better, the defector. Because social connectedness is an iterated game. Players may be somewhat forgiving - instead of tit for tat, they may play tit for two or three tats. But the one who defects, doesn't contribute, too often, eventually gets cut off. (Excepting those who can't actually contribute: children, the elderly, the infirm - human decency often leads to generosity to them.)
In feudalism, again, one must work or starve. Or perhaps be severely punished before having the chance to starve. Peasants must work to feed themselves, plus they must work to feed the lords. The lords may shirk - that's the wicked personal benefit of power - but in theory they also work, providing social order and protection against outlaws.
What of socialism or communism? Again, it's work or starve. A minimum of work must be done by the community/society just to stave off starvation of the whole group, as well as to provide for other needs of the group. The state or society simply can't afford to let people shirk/defect. Maybe they could afford to let a few, but that's risky because then everyone might do it: when defection becomes a social norm, the society is in trouble. So better to make sure people work. And why shouldn't they? Why should they receive without contributing? So in socialism/communism, it is again work or starve.
There is absolutely nothing unique about capitalism in this regard. And it's not clear that work or starve is even a bad thing, as long as it's tempered with some support for those who are only temporarily unable to work, and who aren't actually shirking. But why should the person who refuses to contribute value to other members society - in any system - have an expectation that other members of the society should contribute value to them?
In the long run, defectors get defected on, and a society of defectors must fail (this is the challenge - stiff, but not insurmountable - that all communes face).
The curios thing about critics of capitalism is that they do not blame the first-mover defector, the person who objects to having to work to avoid starvation, as morally culpable. Instead, their hatred is reserved for the second mover, the one who is willing to respond to cooperation (willingness to work) with the choice of cooperation, too (providing value on return for the other's work), but who in response to the first-mover's defection simply respond in kind. "You won't cooperate with me? Then I won't cooperate with you." How is that morally blameworthy?