Why Mars launch windows open every 26 months
Earth orbits the Sun once every 365 days while Mars takes about 687 days. Because the two planets move at different speeds, their relative geometry repeats on a longer cycle called the synodic period, roughly 780 days or about 26 months. Only near this alignment can a spacecraft reach Mars efficiently.
Outside the window, a transfer would demand far more propellant to chase Mars to where it will be on arrival. The window is the recurring stretch when a fuel-efficient trajectory is geometrically possible.
The Hohmann transfer and arrival geometry
Most Mars missions use a Hohmann or near-Hohmann transfer ellipse, the lowest-energy path that touches Earth's orbit at departure and Mars's orbit at arrival. The cruise takes roughly six to nine months. The spacecraft is not aimed at where Mars is at launch but at where Mars will be when the spacecraft arrives.
This is why missions cluster: NASA, ESA, and others launch in the same few weeks, then wait over two years for the next opportunity. Because Mars's orbit is elliptical, some windows are more favorable than others, with the best oppositions giving shorter, lower-energy crossings.