I don't know enough about the topic so I was wondering if anyone has a detailed explanation or can direct to some sources to explain this.
Tbh they weren't really trying to do the same thing at all. Gorbachev was an anti-communist who was literally trying to end Soviet socialism. In his extreme naivete, he thought the Soviet system could be replaced with a heckin wholesome social democracy - of course, the liberals he unleashed weren't going to allow that. Gorbachev was not at all a Marxist, was not working towards Marxist ends, and had no theoretical understanding - and he was a simp for the West. The CPSU, at that point, was pretty much not Marxist and had very little theoretical understanding. The whole of the party and state apparatus was rotten and completely collapsed.
On the other hand, Deng was a committed Marxist-Leninist with an actual understanding of Marxist theory. Now, you can disagree with the "productive forces determinism" interpretation of Marxism (I do, there are some serious problems with it), but it is an interpretation of Marxism. Deng never had any intention of taking China off of a Marxist path. He basically set up a play where the West would pay to relocate all of their productive facilities to China. This was, of course, not without great risk - capitalists would be gaining more power here. But it was Jiang Zemin, not Deng, who let capitalists into the party and introduced the revisionist "three represents." I think things could have continued to disintegrate here. But I am fairly optimistic about what is going on under Xi, and I have a decent amount of hope that China is going to be able to pull out of this and that Deng's gamble will pay off.
So I think it only seems like Deng succeeded and Gorbachev failed if you think of them as both trying to do market reforms or something like that. But if you think, as I do, that Gorbachev was trying to destroy Marxism and Deng was trying to save it, then I would say that both succeeded.
For one, the reform and opening up of China started with allowing capitalist development in just 4 cities. A sort of test where they could see what worked, what didn’t and then expand the reforms gradually to other places. In the end it was a great success and led to rapid development of the productive forces and quality of life for Chinese people.
What they didn’t do was allow capitalists as a class to take political power, despite the attempts at color revolution during events like the Tiananmen Square protests. Deng and the CPC had a way better grasp of theory than Gorbachev who was basically a dumb SocDem.
There’s this quote from Xi which is important:
Why was the Soviet Union dissolved? Why did the CPSU collapse? One important reason was the struggle in the ideological field. Historical nihilism rejected Soviet Union history, CPSU history, Lenin, and Stalin; it messed up the thinking. As a result, party branches perished; the party could not even control the military. Therefore, a big party like the CPSU was dissipated; a big socialist power like the Soviet Union collapsed. This is a vital historical lesson.
The communists lost control of the military in USSR and Yeltsin/the west was able to weaponize it against them.
Gorbachev was a credulous rube who surrounded himself with dedicated anticommunists who he let run the show, who were backed up by a privileged liberal elite who were easily taken in by American propaganda. Further, once he started opening those cracks the response from the west was to incite violent counter-revolution as hard and as fast as possible, while he barred the Communist parties of the Soviet states from defending themselves or each other in any way.
In contrast, China got a better deal from the USA due to the existence of the USSR at that time and when counter-revolutionary movements popped up during liberalization China was prepared to crack down on them because they'd experienced firsthand the cost of letting violent uprisings fester with both waves of the Cultural Revolution as well as the earlier civil strife that resulted in the Anti-Rightist Campaign.
Chinese Cadres touched grass (were forced to live in the countryside) and knew what the effects of a shock doctrine would have for real people.
There's a book titled "How China escaped the shock docrine" check it out.
Short of it is that the Chinese economists were much more careful about the kinds of reforms they were introducing, and they were also much more skeptical of orthodox neoclassical economics.
https://blogs.lse.ac.uk/lsereviewofbooks/2021/09/07/book-review-how-china-escaped-shock-therapy-the-market-reform-debate-by-isabella-m-weber/
Something else to consider on top of all of these great responses was that the privatization of the Soviet Union had started decades before Perestroika/Glasnost - in fact, the rampant shortages that characterized the Soviet Union in the eighties were basically caused by competition between the state-owned enterprises, from the fifties through the seventies shortages were very rare thanks to rock-solid central planning.
They both succeeded at restoring capitalism.
Dengist answer will be that China didn’t liberalise the media which has some merit.
There's better analysis on here about it, but I'll posit that some of it is Western chauvinism. The West viewed the USSR as an existential threat and a world superpower while they viewed China as an underdeveloped shithole where Capital could dump polluting factories and take advantage of cheap labor.