Capitalism is an ideal state where individuals are completely free to make, grow or sell goods and services as they have the personal ability and assertiveness to do so without any regulation or interference from the government. In ideal capitalism, those with the best products and most skillful marketing would earn the most money and those without initiative or skills would starve.
Communism is also an ideal state where all people are equal and the work of everyone is taken by the state and distributed equally to everyone regardless of skill or ambition. Ideal communism is everyone working toward the common good and everyone reaping equal rewards and being taken care of by the state.
Neither of these states exists. What exists is varying degrees of socialism which ranges from democratic socialism - where people are free to work as they wish but are heavily taxed in order to provide for birth to death care by the state - to capitalistic socialism where people have more personal freedom, pay less taxes, but do not have guaranteed care. This range of economic models swings from that of Sweden to that of the United States. Both have a mixture of capitalism and communistic values in play.
After WWII, the USSR took over a large block of nations with the intention of imposing communistic values on them. Without receiving the rewards of individual labor and having those things personally accomplished taken from you, these economies failed. In the late 1980s, it was not war that broke these nations but the lure of individual freedom to determine their own standard of living. As with anything, all nations, except North Korea and Venezuela, live with varing degrees of socialism that is a balance between individual freedoms and caring for the common good of all.