Its defeat by Japan in 1905 brought about Russia’s first parliament and the reforms of Pyotr Stolypin. The Afghanistan debacle of the 1980s created the environment that led to Mikhail Gorbachev’s perestroika.