At the start of the war, France, Russia, and Great Britain were allied against Germany, Austria-Hungary, and the Ottoman Empire. These alliances were created in the late 1800s and early 1900s, as each country sought to protect itself from attack by its rivals.
When the Archduke Franz Ferdinand was assassinated in Sarajevo on June 28, 1914, Austria-Hungary was determined to punish Serbia, which it believed was behind the plot. However, Russia backed Serbia, and Germany backed Austria-Hungary. As a result, the two alliances were drawn into the conflict, which quickly spread across Europe.
The main alliances that contributed to the start and spread of World War I were:
The Triple Alliance: Germany, Austria-Hungary, and Italy (although Italy remained neutral in the early part of the war).
The Triple Entente: France, Russia, and Great Britain.
The Dual Alliance: Germany and Austria-Hungary.
The Franco-Russian Alliance: France and Russia.
These alliances made it difficult for the countries of Europe to resolve their differences peacefully. If one country went to war, its allies were often obligated to join in, even if they did not want to. This made it difficult to end the war once it had started, and contributed to the high number of casualties that the war caused.