Because he was assassinated by Serbian rebels. Most of Europe was allied with someone, a tangle of alliances. Serbia was allied Russia. Austria-Hungary didn't like Serbia. Well when the Archduke decided to visit Sarajevo, he was assassinated by a Serbian assassin. Because of that, Austria-Hungary wanted to punish Serbia and declared war. Well Austria-Hungary was allied with Germany and Italy. And Serbia was allied with Russia. Well Russia attacked Austria-Hungary and Russia was allied with both Great Britain and France.... So it triggered a chain reaction like that.