Communism was a political system that espoused socialism. But socialism and capitalism are first and foremost economic rather than political systems; communism and democracy are the political systems designed to implement those economic systems.
Capitalism has always worked much better than full socialism. You can see it in the relatively high-quality products produced in capitalist economies, versus the shoddy stuff that communist nations produce. You’ve all read about the quality of shoes in Soviet Russia, that fall apart after a few weeks. You’ve seen those pictures of markets in Russia (especially in Soviet days) with mostly-empty shelves, except in the big department stores in Moscow where the elites got to shop. Contrast with the massively stocked shelves in any Western-style supermarket. Ten brands of contact-lens-fluid to choose from, 20 brands of bread, 50 kinds of dry breakfast cereal, and on and on. You’ve probably read the old Soviet workers’ joke “We pretend to work, and they pretend to pay us.”
The point: Communist theorists have always known, implicitly and sometimes explicitly, that their system couldn’t work spontaneously. A totalitarian government, with everything centrally planned and forced upon the people, was the only way that such a system could be maintained (and even then, as we’ve seen, it never worked terribly well).
The capitalist economic system, in contrast, thrives in a free market environment (or at least, mostly-free market), and it was understood from the start (at least as far back as Adam Smith and the other political/economic thinkers of the day) that a free market of ideas complemented this.
It was also understood by communist theorists, at least some of them, that communist nations could never compete well with free-market nations, for exactly these reasons. Thus, one thread of socialism that arose was “Revolutionary Socialism”, that evangelical form that seemed driven to export “Revolution” world-wide. Karl Marx, of course, was a primary proponent of this, so much so that this violent form of revolutionary socialism came to be called Marxism after him.
This was in contrast to “utopian socialism”, in which small communes of like-minded people build a small community with shared ownership of almost everything and shared decision-making. This was tried in a few places in America, but the movement never really sprouted legs here. There were other communes in Europe, and of course the Kibbutz system in Israel. This only works when the entire community is there voluntarily and “buys into” the system. And even then, they tend to get mired in local politics, especially if the commune grows beyond some small size. So these can never be successful at a nationwide level, but only as long as they are small local communities of like-minded people.