Nationalism was the primary cause of the first world war.
Pan-Slavism (Slavic nationalism) was prominent in Austria-Hungary, considering most of its population was Slavic (due to the annexations of several Balkan countries).
The assassination of Franz Ferdinand was executed by Serbian nationalist Gavrilo Princip. Princip was a part of the Black Hand, a secret society that promoted Serbian nationalism, and opposed Austro-Hungarian influence on the Balkans.
The political objective (of the assassination) was to break off South Slav provinces from Austria-Hungary.
The Austro-Hungarian government immediately blamed the Serbian government, thinking that Serbian leadership had been compromised by the Black Hand.
Russia established an alliance with Serbia due to both countries sharing Slavic heritage. This means that Russia's involvement was due to Pan-Slavism.