The short of it is that the USSR and China carried out opposite plans of economic reform. The USSR sought to introduce private property into its economic system, with hopes of engineering a society of free labourers and capitalists in the western model. The Chinese on the other hand introduced capitalist and market practices into their economic system, without changing the property model directly. The result is that in the USSR only the well connected were in place to seize the opportunities of the new system, to hoard property and to become the new oligarchy. Meanwhile in China the government and the oligarchy stayed separate, if interdependent, because property and power hierarchies were more or less unchanged.
Think of a village built around collective land in both countries. For a number of reasons that village is just not living up to its potential. Maybe the central government is fucking stuff up with re-investment, maybe the land is too fragmented to be productive at a certain technological level, maybe the people there just don't wanna farm. Whatever it was something had to be done. So in China the property model was more or less unchanged. The state owns the land and the people possess it. Only instead of old political practices of setting up supply chains and quotas, the chinese bureaucracy introduced market driven levers to incentivize and motivate the labourers. Inputs and outputs relating to those chinese farms were subject to price mechanisms rather than direct resource allocation. In the USSR the village was privatized, ostensibly so that the locals would then own their land and become capitalists, which therefore meant that capitalist practices would follow. Instead what predictably happened was that the bureaucrats themselves were the ones with capital and connections to seize those new private properties. Consolidations lent themselves towards oligarchy.
One cannot understate the role of foreign advisors in this process. It was western advisors who pushed for this sort of social re-engineering in the USSR, and it was also western advisors who pushed for financial liberalization. The way Jeffrey Sachs describes it, the rapaciousness with which the oligarchs could seize wealth in the USSR was only possible because of the rule of law in the west - financial assets were stolen in the union and sent towards the west, to London. Where they were protected from justice. Meanwhile in China the chinese themselves were the ones inviting groups like the Carter Foundation to help reform the electoral system. The Chinese did not bring in westerners to tell them what to do economically or politically, they brought them in to get their input on achieving what they actually wanted to achieve all along.
Mind you, what I'm describing are broad theories and in some ways idealized versions of both the soviet and the chinese experiences. Just a quick look into that last statement I made and a chinese person might take exception to it: chinese elites did go to the west and learn economic theory there, so its not like the Chinese had total control and self determination on that front. And that's true. Ultimately, what we can say is that the USSR and China took very different paths - former inspired by the US, the latter by Japan and Singapore - and that all political economies - capitalist or socialist - are a permanent exercise in change, transformation, social construction and so on. The Dengist adage is that all societies have markets, the world had markets before capitalism even existed and it is true. The moral economies of pre-capitalist Europe, for an instance, despised the very notion of free floating prices on a local level. So the logic goes that there's no problem for a socialist economy to have markets as well. Only it doesn't stop there: that socialist economy is, like all others, on a permanent struggle between political and economic power. Even theoretically, there has to be more or less liberal tendencies, periods and so on all the way towards communism.