Historians disagree about what 'caused' the First World War, but most trace it in some degree to the growing power of Germany. The 'balance of power' between the nations of Europe became unstable. This led them to form military alliances:
After the murder of Austrian Archduke Franz Ferdinand in June 1914, Austria-Hungary declared war on Serbia. The countries of Europe found that the alliances they had formed dragged them into war.
In August 1914, Germany invaded France through Belgium, using its plan for war ‒ the Schlieffen Plan. The German attack was forced back at the Battle of the Marne in September 1914. Both sides dug defensive trenches and the war ground to a halt.
For the next four years, the war on the Western Front consisted of a deadly stalemate. The battles of Verdun and the Somme in 1916 and Passchendaele in 1917 were key events where each side tried to wear the other side down.
In 1917, the Americans entered the war. Before they could arrive, the Germans made another attack in March 1918. It was successful at the start, but the Germans failed to break through. They were pushed back in August 1918. Two months later the Germans signed the Armistice.