A stalemate occurred during World War I because the German invasion of France failed, and Germany could not destroy British and French troops. The stalemate occurred after a particularly brutal battle in Belgium in which 27,000 French troops were killed in a single day.
Once both sides realized they were in the middle of a stalemate, they quickly began digging trenches to prepare for the next phase of fighting. Both sides were exhausted, and this was the kind of war never before seen. By the end of the war, each side had dug close to 12,000 miles of trenches.
Before the stalemate occurred, both sides thought that the war would be quick and that they would suffer few casualties. Both sides underestimated the strength and tenacity of the other, and the Germans were convinced they could take Paris in only 42 days. When that didn't happen and the war dragged out for longer than anyone expected, a stalemate occurred. Efforts to end the stalemate were brought about by the British army, whose attacks lasted for more than three months without making any headway. The movement to end the stalemate by both sides resulted in the loss of more than 1 million men.
All in all, World War I took more than 5 million lives and lasted from June 1914 until 1918.