World War One was virtually inevitable. The assassination of Franz Ferdinand and his wife only lit a fuse which was waiting to be ignited. The assassination itself did not cause the war; the underlying events were already in place.
The series of alliances in Europe, primarily the Triple Alliance and the Triple Entente, had created tension across Europe. Additionally, the rise of nationalist sentiments, which did not always correspond with political boundaries, was a significant issue. Under the terms of the Berlin Conference of 1878 (called to prevent a European war over African territories) Austria-Hungary, then a dual monarchy, was given the right to "administer and occupy" Bosnia and Herzegovina without regard to the wishes or cultural nature of the people of those areas. In 1905, they were formally annexed into Austria. Tensions led to a series of minor wars in the Balkans in which Austria intervened, thereby increasing tensions.
Outside the Balkans, there was rising concern over the expansion of Germany's military, particularly its navy which stood to challenge the British navy's supremacy of the Atlantic. There was resentment toward Great Britain because of the Boer War in Africa, and resentment in France toward Germany because of France's humilation in the Franco-Prussian War. If one adds to this mixture the growing rivalry for empire and commercial markets between European powers and the bungling of Kaiser Wilhelm II who not only fired Bismarck (who might have kept the lid on things) but also made a number of intemperate remarks which infuriated the British; one can see that the outbreak of the war was only a matter of time. That time came with the assassination of Ferdinand and Sophie.