Rightly or wrongly, Austria believed that Serbia had been directly involved in the assassination and declared war. Austria's ally Germany entered the war but, somewhat irrelevantly, promptly invaded Belgium. Since Belgium's independence was assured by treaty, an alliance including the UK, France, Italy and Russia declared war on Germany. Within six weeks of the assassination, all Europe was at war, and remained so for more than four years, gradually encompassing the rest of the world.
Or arguably, for the next hundred years. The War to End All Wars led, as Sellar & Yeatman put it, to the Peace to End All Peace, the Treaty of Versailles, whose provisions not only led directly to the Second World War, but also to conflicts that are still being played out in many parts of the world, notably the Middle East. Some historians talk not about the First World War, the Second World War, the Cold War etc., but the Great Twentieth Century War.
It might seem an odd way for a world war to begin, but there've been stranger flashpoints for wars. In 1739, a Royal Navy captain called Jenkins was captured by the Spanish and had his ear cut off. An outraged Britain declared what became known as the War of Jenkins' Ear. In 1618, the Defenestration of Prague (right) — the throwing of three imperial representatives out of an upper-storey window — sparked of the Thirty Years War, which lasted till 1648 (not a given — the Hundred Years War lasted 116 years). And, of course, the most famous war that may or may not have actually happened was started by the abduction of the Queen of Sparta. Jonathan Swift satirised absurd reasons for war in Gulliver's Travels, in which a vicious conflict is fought over whether an egg should be opened at the big or little end.
The majority of fantasy novels involve war in one way or another, but their causes are usually rather banal: a bastion of civilisation is threatened by barbarians, a tyrannical warrior-king wants a bigger empire, two dynasties claim the same throne, an Evil Overlord wants to rule the world simply because he's Evil… and so on.
As anyone who's studied history knows, the most common reason by far for wars is the desire for economic advantage. A country might want to control important trade-routes, dominate the markets in a particular area, or just have access to the rich resources of the conquered lands. The last was especially true of European expansionism from the 15th century onwards, in Asia, Africa and the Americas.
The rise and fall of the Roman Empire provides an excellent example. In general, the Romans invaded far-flung lands because either they controlled vital trade-routes, or they possessed mineral wealth (that was certainly true of Britain, in particular its tin resources) or because it provided fertile lands to back up the populist policy of handing out free bread to everyone in Rome. And, a few centuries later, the barbarian tribes who smashed their way into the empire did so because they wanted to share in its wealth. Not, as is common in fantasy, because civilisation was morally abhorrent to them. Most of them liked what they saw.
Of course, there are many other reasons why countries and peoples go to war: ideological and religious, security, revenge against old enemies, or just plain love of conquest and glory. Still, scratch the surface and you'll probably find economics. Alexander the Great (left) is usually portrayed as conquering for the sake of conquest, but the fact remains that the Persian Empire was not only incredibly rich, but also controlled the routes by which fabulous spices and fabrics came from the mysterious east. The Crusaders, nominally motivated by religious zeal, were after the same trade routes, as well as the riches of a civilisation beside which western Europe was a beggar at the gate.
The Second World War was certainly to a large extent an ideological war, with one side pursuing a concept of racial destiny, while other fought for independence and democracy. Still, part of what lay behind Hitler's expansionism was the idea of lebensraum, room for living, the historical German desire to annexe and move into the rich lands around them. The US-Japan part of the war, by contrast, was almost entirely a battle for economic control of the Pacific.
Economics rarely seem to make it into fantasy wars. Of course, we're not privy to Sauron's counsels, for instance, so it's possible that his aim in neutralising Minas Tirith was to take control of the Anduin, the most important artery for moving goods around western Middle Earth; but somehow I doubt it. Though there is a hint that Saruman's conquest of the Shire was partly motivated by a desire to control the supply of pipeweed.
Things don't seem to have got any more realistic in the modern, grittier style of fantasy, where war seems to happen simply because it's what you do when you're a powerful king or lord. You do, of course, but there are normally reasons for it.
There's a problem with war, though. (Well, there are a lot of problems, of course, but I'm talking about one in particular.) Wars aren't fought by the people who actually get rich from the trade or the resources, they're fought by ordinary joes who would usually far rather stay at home raising their crops or working in an office. Even if they're conscripted, they need to be given a reason to fight well.
The Trojan War (if it happened) was probably fought over control of the sea-route between the Aegean and the Black Sea; but that's not what you tell your soldiers. You tell them The filthy barbarians stole my wife — yours might be next, if we don't put a stop to it. The War of Jenkins' Ear was all part of the competition for control of the seas that had been going on between Britain and Spain since the days of Drake and the Armada; but the people doing the fighting would have been told of the outrageous way the Spaniards treated their prisoners.
And, if all else fails, you just spread stories about how generally barbaric and subhuman the enemy is. This was certainly true in the First World War, where "everyone knew" about the sickening atrocities the German soldiers committed (and, presumably, they "knew" the same about the Allies). Curiously, that seemed to be far less true in the Second World War. My parents, who were both in their teens when the war broke out, recalled that most people regarded the enemy as "the Nazis" rather than "the Germans". Perhaps there was already enough moral cause to make inventing one unnecessary.
The First World War can be interpreted in many ways. The historian A.J.P. Taylor argued that it was cause by railways timetables (which makes sense to anyone who commutes by train) by which he meant that deployment by rail, the state of the art method at the time, was already predetermined and was triggered regardless of the cause of war. Taylor drew a chilling lesson from that with regards to preparations in the Cold War.
Nevertheless, in hindsight war had been inevitable for a long time. The Great Powers of Europe were jockeying for position, and that meant primarily their ability to economically exploit the rest of the world, especially Africa and Asia. The logic of great economic and military powers demanded that they should fight it out between them, and only needed Gavrilo Princip's starting pistol. Franz Ferdinand was in the wrong place at the wrong time.