The Western Front in World War I turned into a stalemate for two main reasons. First, the German Schlieffen Plan was not carried out well enough to overrun France before the French could get their defenses settled. Second, once the defenses were set up, the technology that was available in 1914 favored the defensive and prevented either side from making any decisive attacks.
Going into the war, the Germans were supposed to use the Schlieffen Plan to overrun France. This plan envisioned a massive German attack on the German right (through Belgium and in through northern France) that would destroy the French and give Germany a quick victory. However, this plan did not quite work as planned. The German forces were delayed by various factors, throwing off their timing and allowing the French more time to dig in. The Germans’ lines of communication and supply were badly overextended while the French could use their short, internal lines of communication to supply their armies. This allowed the French to stop the Germans deep in French territory, but before Germany could force France to surrender.
Once this was accomplished, technology took over. The most important technology was the machine gun. Trenches that were defended by men with machine guns were impossible to attack successfully with the technology of the time. Since both sides had trenches and both sides had machine guns, there was no way that either side was going to be able to pull off any sort of a major attack. This led to the stalemate on the Western Front that lasted for about three years.