World War I was triggered by the assination of Archduke Franz Ferdinand who was the heir to the Austro-Hungarian throne.
Three weeks after Franz Ferdinand's death, Austria-Hungary declared war on Serbia on July 28th, 1914. This led to France, who was under treaty with Russia being at war against Germany.
Germany then declared war on Russia on August 1st, 1914. Britain, who was allied to France, found themselves also declaring war against Germany. With Britain being a part of the war, it's colonies and dominions also included Australia, Canada, India, New Zealand, and the Union of South Africa. With Japan honoring a military agreement with Britain, they also declared war on Germany on August 23rd, 1914. Italy avoided joining the war, while being allied to both Germany and Austria-Hungary. When needed, Italy agreed to defend both allies.
Two years after countries declared war, Germany and Austria-Hungary concluded they would bring Italy into the war, with the signing of the Tripple Alliance. With this treaty, Germany and Austria-Hungary promised to assist Italy if they were to be attacked by France. Italy swore they would assist Germany and Austria-Hungary, if they were to be attacked by France.
One year later, Italy saw the war between Germany and France was too agressive, and they went under alliance with Britain, France, and Russia.
World War I came to an end on November 11th, 1918.