World War 1 had many causes- one of them most prominent being the Alliance System. The logic was that the more allies you had, the less another nation would want to face you in battle. However, as the most powerful European nations split into two factions, the Central Powers and the Allies, rising tension left Europe with baited breath on who would declare war first.The diagram shows the two sides of World War I, the Triple Entente and the Triple Alliance. The Triple Entente was made up of Britain, France, and Russia. France and Russia forged an alliance when Kaiser Wilhem II of Germany allowed it's treaty with Russia to lapse in 1890. Britain, frightened by Germany's new shipbuilding program, forged ententes with France and Russia in 1904 and 1907. This did not ensure Britain would fight for France or Russia, but it almost guaranteed Britain would not fight against them, should conflict arise.
The Triple Alliance was made up of Germany, Italy, and the Austro-Hungarian Empire (henceforth referred to as AusHun). The German chancellor in the time Wilhelm II, chancellor Otto Von Bismark, created the Dual Alliance between Germany and AusHun after the unification of Germany. He also made the friendship treaty between Russia and Germany. Both of these were done to isolate France, who Bismark feared would try to start a war against the newly formed German state, in vengeance for taking Alsace-Lorraine. Italy joined to make the Triple Alliance in 1882, and the Ottoman Empire joined them in 1914.
What triggered the Alliance System was the murder of Austrian Archduke Franz Ferdinand and his Sophie in Sarajevo, Bosnia and Herzegovina. They were killed by a Bosnian Serb, Gavrilo Princip. This caused AusHun to declare war on Serbia, and then Russia to declare war on AusHun.
A bit of history; (ha) the Balkans, the region of the aforementioned countries, was known as the "powder keg" of Europe. Due to the Ottoman Empire's declining power, these countries gained independence, and wanted true autonomy and respect from the European Powers. Countries like Russia and AusHun, however, wanted to get into the Balkan countries and control them. AusHun had recently annexed Bosnia and Herzegovina; this only angered their Serbian neighbors.
A Serb murdering the Austrian Archduke and his wife was enough for AusHun to go to war with Serbia. They wasted no time on formalities, and sent Serbia a ultimatum: surrender your country to our empire, or fight us. Serbia chose to fight.
This drew Russia in the war. Russia had promised Serbia that if anyone should attack them, they would come to their aid. So, they mobilized the army; and mobilized along the German border as well. Coming to Serbia's defense against AusHun meant they war against the German Empire; as well as the unified Germany. Germany in turn declared war on Russia and France; France declared war on Germany. Britain stayed out for about a week; then Germany violated Belgium's neutrality, and they declared war on them.