The four main causes of WWI were international alliances, imperialism, militaristic growth and nationalism among the European countries. These elements led to war in 1914
From 1879 to 1914, eight different alliances were reached by various European nations. These agreements forced countries to go to war if one of their allies did so first. Fear of Russian expansion caused the signing of treaties between Germany and Austria-Hungary and then between Austria-Hungary and Serbia. Further alliances were formed by Russia, France and Britain in response to possible German and Austro-Hungarian aggression.
Many European countries held colonies in other parts of the world, especially Africa. The bulk of these colonies were held by Britain and France, and this increased their resource production and gave them an economic advantage over Germany.
The rivalries among the nations of Europe led to increased military production. France, Germany and Britain increased their armies and constructed powerful warships in an attempt to stay ahead in the arms race. Nations began drawing up plans of attack should the need arise.
Previous wars had left Germany and Italy as divided nations, which was a blow to national pride. France had lost territory to Germany after the Franco-Prussian war, and wanted the land back. Serbia and Austria-Hungary housed many groups with differing ideologies who wanted to be free of their parent nations.
In 1908 Austia-Hungary invaded Bosnia, and this eventually led to the assassination of Archduke Ferdinand in 1914 by Gavrilo Princip of Bosnia, triggering the alliances and beginning the war.