This is a central historical problem for Marxism. Marx himself, and the early communists generally, assumed that communism would arise in urban, educated environments, as the proletariat achieved rational consciousness. In particular, Marx believed that *Germany* and the *German labor movement* would be the locus of communism. From the very core of capitalism, places like England and Germany, socialism was supposed to arise, then flowering into communism. That is because socialism and communism were supposed to be uber-rational developments in the development of reason triumphing over tradition, and so it made sense they would arise in the most sophisticated and civilized urban environments.
But communism actually arose primarily in brutal, uneducated, provincial contexts, notably Russia, rather than in the developed capitalist core regions.
Marxists struggled to explain this paradox, and they also struggled to explain why the predictions didn't come true and Jesus didn't arrive with the Second Communist Coming as Marx had predicted. There are libraries full of Marxist explanations and theories about this, most centering on the idea that the forces of reaction turned out to be more sinister and controlling than Marx had understood.
Nowadays Marxism is more about holding faith and being pious rather than belief that the Second Coming is truly imminent; that's an article of faith that nobody actually believes. This is why the Chinese communists hold 'true communism' up as sort of a vacuous far-off ideal, and most Chinese nowadays think of the communists as like Jehovah's witnesses.
I can't comment on whether the Chinese truly think of Communists as equivalent to millennialists like the JW, but the most obvious reason why capitalism persisted in Germany (and the United States) is simple:
Capitalism grew wise to the social discontent it had produced.
Marx's conception of capitalism is an extremely unfettered, unregulated, completely laissez faire type of Capitalism that we tend to think of when we think of the industrial revolution in England or, for a period, in the US. The US and Germany were amongst the earliest to recognize that capitalism, if it is not to be overturned by Reds, would have to regulated by a state looking out for the common weal. Thus you see Bismarck undercut the Reds via vast social policies, and the American system moderating capitalism tremendously in the US and eventually legal recognitions of unions, some regulatory laws passed, et cetera.
Eventually, all 1st world capitalist systems began to accomodate social welfare, to varying levels, to undercut the threat of Communist welfare.. Some went as far to become something like a mixed economy, such as the Nordic social welfare states, whereas others remain broadly liberal.
Those countries which never saw any sort of real mitigation of the excesses of capitalism (such as in say South America) either fell into the power of military governments or of socialst revolutions.
Russia and China, because they never truly were capitalist, could not accomodate any sort of social reform that would've kept the Reds at bay. They broke Marx's theory of history by going from feudalism into socialism immediately.
What's worrying now is that Marx might yet be proven correct that Capitalism will eventually succumb to Socialism, because we are increasingly moving towards such a system whereby capitalism is paired with a vicious disregard for the worker, as in Capitalism. I call this internationalist, globalist, poor-living standard capitalism Sino-Capitalist, and it seems to be the spreading trend. When capitalism will no longer support a middle class, it may well end up being replaced by the revolutionary movement. Which would, of course, be disastrous.