The assassination of Franz Ferdinand was a perfect excuse for Austria-Hungary to declare war on Serbia. Seizing the opportunity on July 25th, Austria-Hungary issued what has now become known as the July Ultimatum, the terms of which were so severe that Austria-Hungary fully expected Serbia to reject them. In fact Serbia replied in a conciliatory manner, accepting most of the terms. Nevertheless Austria-Hungary wanted war and on July 28th 1914 they declared war on Serbia.
What followed was a mechanical sequence of events started by Austria-Hungary's declaration of war on Serbia:
Russia started to mobilise her army against Austria-Hungary in defense of Serbia.
On August 1st, under the obligations of the alliance with Austria-Hungary, Germany declared war on Russia.
Due to the treaty with Russia, France found herself at war with Germany and Austria-Hungary.
Germany executed the Schlieffen Plan, which in the event of war with Russia and France, had been designed to eliminate France before Russia could fully mobilise her army. The Schlieffen plan took German troops through neutral Belgium.
On August 4th Britain, bound by treaty to protect Belgian neutrality, declared war on Germany. The British colonies and territories like Australia, New Zealand, South Africa and Canada all supported Britain to various degrees, many supplyin manpower for her armies.
Italy initially refused to enter the war declaring that the Triple Alliance was defensive in nature and that the conflict was started by the offensive action of Austria-Hungary. Italy later entered the war in May 1915 on the side of the allies.
In a matter of days the Great Powers of Europe and their colonies were at WAR!
Japan, Turkey and the USA all entered the conflict a later dates for a variety of reasons, escalating the European war into a true World War.