There were several causes of World War I (hereafter called WWI), but there were none as significant as the assassination of Arch-Duke Franz Ferdinand, of Austria, in Serbia. Berfore this, however, were several background causes. These will be looked at first.
The first background cause was the growth of national feeling, and the emergence of true nationalism among all the countries in Europe, especially in Serbia, where the Slav peoples of southern Europe desired to be rid of Austrian rule. There was also rivalry between Britain and Germany over colonialism, and Britain was cornering the trade sector of the world. These, coupled with rivalry between France and Germany after the Seven Weeks War of 1870, and hostility between Austria and Serbia over Austria's rule, did not make for a friendly atmosphere in Europe.
The second cause was more of an imperial nature. Basically, this involved the competition for colonies in the Balkans, China, and North Western Africa, and German eagerness for colonies in Central Africa and East toward Constantinople. Also involved was the Berlin to Baghdad railway; this caused much international tension and set all the nations wondering about Germany's real intentions.
The third was the human tendency to strive to be better than one's peers - the Arms Race. Gradually at first, then at an ever-increasing pace, more and more countries began to build up their arms arsenal. France, Germany, Russia, Britain and Austria were the main culprits of this. Germany began to increase her navy, to look after her rapidly expanding colonies, and this increased international tension and the intensity of the Arms Race no end.
The fourth, and last, major background reason was the eventual but inevitable separation of Europe into two major power blocs. These were held together by a series of alliances and agreements, and were constantly being updated, outgrown, and overthrown. The first bloc consisted of France, Russia and Britain, and the second of Germany, Austria-Hungary and Italy. The main cause of the formation of these blocs was the emergence of two new powerful nations; Germany and Italy. These nations had, over the years, tipped the balance of power in Europe from neutral to unstable, and so all the countries in Europe reflected this. These blocs were against each other, but it was a Cold War, rather than a physical one. For now.
In the light of all this, Europe around the turn of the century was not all that a pleasurable place to be in. International tension was heightened, and everyone was nervous. Gradually, the sporadic outbursts of isolated violence bubbled over into a national issue, and then international, and then global.
The first sign of trouble was in Morocco; Germany wanted it but France had it, and a crisis began. It was resolved with an international Conference, in which Germany was defeated. Then Serbia, Bulgaria and Greece united against Turkey, fought, and won. She lost most of her European territory. Arch-duke Franz Ferdinand of Austria is assassinated in Serbia; Germany agrees to support Austria in case of trouble. Austria demands that its officials be allowed to enter Serbia to quell anti-Austrian feelings; request denied.
The stretched cord of peace snapped; Austria-Hungary declared war on Serbia. Russia mobilises troops to aid Serbia. Germany demands that Russians demobilise. Request denied. Germany and France mobilise; Germany declares war on Russia. Germany declares war on France after a denial of her neutrality. Britain demands that Germany withdraw; Germany refuses and Britain declares war on Germany. Austria-Hungary declares war on Russia. Britain and France declare war on Austria-Hungary. Italy joins Britain, France, and Russia. The war had begun.