The nearest great power rival of the Russian Empire in the early 20th century was the rickety Austro-Hungarian Empire. As part of this competition, Russia eagerly encouraged Slavic nationalist movements, especially in Serbia, which wanted to carve off a chunk of the Austrian flank with a large Serbian population. So when Serbian nationalist extremists assassinated the heir to the Austrian throne, Russia backed them to hilt, figuring in part that after an Austrian crack-up, there would be easy territorial pickings for Russia and its allies. They weren't wrong about the Austrians.