There are four main causes of WWI:
Militarism-Countries in Europe were continually building up their militaries, in order to look stronger.
Alliances-European countries were allied with each other, which caused all of Europe to break into war within a few days of Austria-Hungary declaring war on Serbia.
Imperialism-Wealth equals power, therefore, the more colonies you have, the more powerful you are.
Nationalism-Having pride in your country and thinking your country is the best, ignoring it's faults. Led to increased imperialism.