Militarism, alliances, imperialism and nationalism were the four main causes that directly led to World War I. The arms race was enormous, and European powers pushed deep boundaries of the military capabilities, not to mention the planning of wars themselves. Such widespread militarization always existed and prepared tension, and the state of war in the whole continent.
The alliances stood very rigidly and Europe was divided into two groups: Triple Entente (France, Russia and Britain) and the Triple Alliance (Germany and Austria-Hungary). These legally binding treaties implied that any war between member states had a serious chance of involving the allies and a drastic lack of foreign crisis resolution involving diplomatic approach.
The rivalry created by heavy imperialism created strong tensions among major powers. The rush of colonies and world dominance led to a lot of suspicion and enmity. The causes of the friction were mostly territorial in nature, particularly in volatile regions, causing tensions of the international community and giving the notion of zero-sum benefits.
The nationalism was also strong and disrupted the political situation. The presence of demands for independence or unification, especially in the Austro-Hungarian empire and the Ottoman one, placed internal pressures. The threat of Serbian nationalism with its efforts of uniting South Slavs directly challenged the territorial integrity of Austria-Hungary, which destabilized the existing situation in the region.
The attempted assassination of Archduke Franz Ferdinand by a Serbian nationalist in June 1914, was the immediate causality. Austria-Hungary backed by German demands sent a harsh ultimatum to Serbia. The alliance system was triggered by the move of Russia to mobilize as an ally of Serbia: Germany and France declared war on Russia. The invasion of Belgium by Germany later dragged Britain into the fast developing global conflict.
Conclusion:
World War I was actually triggered by the dangerous combination of militarism, unwavering alliances, imperialistic competition and severe nationalism. It was the assassination that was merely the tipping point. The alliance system took a local conflict and turned it into a European-wide war, and was used to show how these fixed groups drove Europe and the globe into the staggering war.