Answer:
- Austria-Hungary was responding to a direct attack against members of its royal family. Austrian Archduke Franz Ferdinand and his wife were assassinated by terrorists in Sarajevo, Serbia. Austria-Hungary held Serbia responsible.
- Russia mobilized troops in keeping with an alliance it had with Serbia, offering them protection against the threatened military action by Austria-Hungary.
More details:
Various systems of alliances were put in place before World War I. The two main alliance systems were the Triple Entente, which had Britain, France and Russia as allies, and the Triple Alliance, which had Germany, Austria-Hungary, and Italy as allies. There were also other alliances, such as Russia taking on recently independent Serbia as an ally, as both had ethnic Slavic populations.
So here's how the start of World War I happened. When the Austrian prince and his wife were assassinated in Serbia, the Austrian government threatened the nation of Serbia with retaliatory action (even though the assassination was carried out by a terrorist group, not the Serbian government). Russia responded to Austria's threat, because Russia was bound to protect its Slavic ally, Serbia. Germany responded to the mobilization of Russian troops, and when Germany declared war on Russia in 1914, they implemented a military plan (the Schlieffen Plan), which assumed war would mean they'd have to take on all members of the Triple Entente alliance. So as soon as Germany declared war on Russia, they sent troops to go attack France. That pulled France and Britain into the war immediately as well, and the war spread and became a global conflict.