A number of different factors contributed to a situation where the First World War could break out.
The Threat of Germany
Germany had been made up of a number of separate states but became a united 'empire' in 1871 by defeating and humiliating France in the Franco-Prussian War. This gave Germany greater strength to develop.
After 1900, Germany built up its navy - this frightened the British.
In 1901, Kaiser Wilhelm II demanded an overseas empire for Germany – this frightened Britain and France.
Germany wanted to build a railway through the Balkans to Baghdad – this alarmed the Russians, who said they were the protectors of the Balkans.
Germany's military defence plan – the Schlieffen Plan – involved attacking and defeating France quickly and then turning its armies on Russia.
The Turkish Empire in the Balkans collapsed:
Nationalist interests became clear when the new nation of Serbia clashed with Austria-Hungary.
Austria-Hungary and Russia clashed because they both wanted more power in the Balkans.
The System of alliances
Two opposing groups had grown up by 1914, believing that a 'balance of power' would prevent war:
The Triple Alliance of Germany, Austria-Hungary and Italy (1882).
The Triple Entente of France, Russia and Great Britain (1907).