An ally like Iran is bound to fuck up at the time you need them most. They had decades of relative peace, only to waste it. Contrast this with North Korea, to which China does provide support.
Russia plays into the US adversarial mentality, which is why in 2025 they are 3 years into a shooting war with their neighbour, whereas China flew the world's first 6th gens, has leading AI models and is on its way to self sufficiency in all critical technologies.
Russia is in a bad position because it trusted the US and surrendered to it in 1989-1991, thinking that if it ended the Cold War and gave Ukraine independence, the US would respect its zone of influence and not expand NATO. Instead, the US continued to treat Russia as an enemy and couped the democratically elected leader of Ukraine to appoint their guy.
The Iranians believed US promises that Israel would not attack, and failed to move their generals and nuclear scientists to safe hiding locations. Israel's occupation of Gaza and the West Bank is based on a sneak attack on the Egyptian air force in 1967. Always getting caught by surprise by Israeli/Western attacks.
The lesson of it all is never trust the West, no matter what "deals" they claim, it is just waiting for an opportunity to stab you in the back. Western expansion since 1492 has been based on war in the end, nothing else, and they will never stop.