What were the specific potential rewards for junior Soviet and Chinese politicians to rise to the top, when there was a substantial chance that they could end up like their former leaders who were overthrown or worse?
Even for the leaders who weren't overthrown, is there any evidence that they were continuously worried about being overthrown?
This question betrays misunderstandings about human nature, let alone USSR & PRC politics.
Some people are ambitious. Ambition isn't always bad, but it can be, especially in an environment that does not value human life. Some people are both ambitious and reckless, and will keep climbing even if it puts them and others in danger.
More to the point, in said environments, it's not as if you can opt out of the rat race. Even in normal circumstances, refusing a promotion is often career suicide. If the secret police kill your manager and want you to replace him, refusing looks like you are siding with him... actual suicide. In the Great Purge or Cultural Revolution, people at the bottom of the pile or the middle were no less likely to be killed than people at the top. The only way to avoid being denounced was to denounce everyone who might possibly be thinking about denouncing you... and this was no guarantee.
Take the example of Lin Biao. He was anointed Mao's successor. He did not want to be that. However, it happened because he had a cunning plan to do absolutely nothing except support whatever Mao said and denounce whoever Mao denounced. This backfired when other CPC poobahs got jealous of his status and started a whispering campaign against him. He fled in an airplane which crashed under mysterious circumstances.
Lastly, your characterisation that people at the top are always getting overthrown is not quite right. Lenin, Stalin, Brezhnev, Andropov, Chernenko, Mao, Deng, Jiang and Hu were all top dog until they died of old age, or were simply too old to carry on. Khrushchev, Hua, and Gorbachev were removed from office, but none of them were killed. Maybe the getting to the top was the only way to stay safe!
The question is wrong in fact. As Milovan Djilas’ New Class demonstrated with the Soviet case and as post-1989 demonstrates with the Chinese case the nomenklatura calms down after any effective opposition is crushed.
This is visible in Sheila Fitzpatick's account of the purges where lower level figures used it to clear out old bolsheviks: it wasn’t a permanent feature, even if it was repeated for a limited period. And Djilas on cementing power for the nomenklatura as a class or stratum explains why a ruling class would bleed itself stupid.