The USSR collapsed because of imbalances caused by decades of centralized planning and control.
China survived communism because it implemented free-market reforms (while retaining centralized control in the political structure).
I'd say generally, the free market is what makes economies work.
Edit: minor rewording