Ah, a thread after me own historical heart...
I'm not sure about whether it was inevitable or not. You must remember that the European powers did manage to keep the continent relatively peaceful after the 1815 Congress of Vienna, for almost exactly 100 years. That's not a bad record. Yes, there were several smaller, regional wars throughout that period (1815-1914), but none of them threatened to de-stabilize the whole continent by turning into a general European melee, a la the Thirty Years War, the Seven Years War or the Napoleonic wars. When one did - the Belgian/Polish rebellions of 1830-31, the 1848 Revolts, the the Crimean War, the Austro-Prussian War, the Franco-Prussian War, the Balkan wars, the Russo-Ottoman Turkish wars - the Great Powers met and conferred on how to resolve the situation. The 'balance of power' policies that are frequently blamed for World War I's outbreak really had kept the general peace in Europe for a century.
Their breakdown is due to two outside forces that few could have seen in 1815: Industrialization (and the creation of mass society, with its universal education, etc.) and ethno-linguistic Nationalism. Simply said, the world of 1815 did not look anything like the world of 1914 - which was a problem because the Diplomacy and Politics of 1914 had largely been designed in 1815.
It's not very easy to assign blame for the war's outbreak, though many history books today make it seem so easy. Just about everyone comes out looking quite guilty of having contributed to the general breakdown in Great Power relations in July, 1914. (On a side note I found it heartening to discover that U.S. President John Kennedy and his brother Robert had consulted Barbara Tuchman's excellent history of the events leading up to the outbreak of World War I, The Guns of August, during the very ugly Cuban Missile Crisis. I have this fear that President George W. Bush now is reading comic books during our current crisis...)
Serbia, while having legitimate border issues with the Habsburg empire, was a nest of terrorism. (Where have I heard that recently...?) The Crna Ruka group led by Apis had heavily infiltrated the Serbian Army and government, and while Pasic almost certainly did not have a hand in the assassination of the Archduke in Sarajevo, he almost equally certainly knew about it before-hand. The Austrians had to respond, as any country would. However, the Austrians (under Berchtold) refused any solution but all-out war. They were also dogged by the rise of nationalism among the many nationalities of their empire but in reality most of their nationality policies would be considered enlightened even in today's modern Europe. As well, in their defense while the Habsburg Empire did indeed divide and cross many ethnic boundaries, Europe would learn throughout the rest of the 20th century that despite Woodrow Wilson's optimism about "The nations' right to self-determination" it is impossible to draw national borders in Europe that don't leave substantial minorities somewhere. Berchtold drove ill-equipped Austria to war, while Russia fumbled with mystical ideas of Slav brotherhood and clumsily ordered partial, then full mobilization of its army - which is the linchpin of how a small regional war became a continental-wide war. The Germans, fearing a future powerful Russia, decided to seize the moment and start the war to defeat her enemies before they had fully matured in strength. The Germans had the infamous Schlieffen Plan to first defeat France, then Russia in a swift two-front war. As many military historians point out, this plan was highly flawed and called for the movement of resources on a scale that hadn't actually existed at the time Schlieffen wrote the plan. In other words, it was based on lots of guesses and wishful thinking. With the ball already rolling between St. Petersburg and Vienna, the Germans decided that if there was going to be a war they might as well use it to sort out their traditional enemies, the Russians and the French, while Germany still had an edge.
Britain is usually portrayed as sitting innocently on the sidelines, not getting involved until the Germans violated Belgian neutrality. However, as someone once convincingly demonstrated to me through their research, Britain's ultimate reason for joinging the war was a fear that Germany would challenge Britain's world-wide hegemony. Usually cited is that Wilhelm II started building a massive navy in the 1890s. The Germans saw the British navy as the real reason behind British success and imperial power, so they wanted one of their own. They wanted to seize some of the Portuguese, Spanish and maybe even some of the French colonial possessions and establish a German empire comparable to the British. The British, however, only saw the German navy as a rival and a threat - London assumed the Germans wanted to seize British colonies and maybe even the British Isles, although this wasn't the case. An acquaintance spent much time reading popular novels and fiction from Britain in the period from the 1890s til 1914, and he said many of them were obssessed with the idea of a foreign invasion of Britain, at first by the Russians, then by the Germans. The point was, Britain was caught up in a hysteria that Continental barbarians would soon scale the Cliffs of Dover and re-create the battle of Hastings. The bottom line is that while the Germans certainly decided sometime in mid-July 1914 that they wanted a war with France and Russia (and possibly even Britain), it could have been avoided just a sseveral other international crises had averted war recently (the Moroccan crisis, for instance). The British in 1914 thought the Germans wanted to invade (they didn't), so the Foreign Office acted accordingly and defensively. John Keegan makes the point strongly in his book last year on WW I that all the Great Powers fumbled and failed in 1914 to stop a crisis that could have been resolved diplomatically.
This is for me the most fascinating period of history, as indeed we seem to be at a similar crossroads today with two civilizations glaring at each other through propaganda and stereotypes, both ready for war without really understanding what war means or what the other wants.