A solar eclipse occurs when an observer (on Earth) passes through the shadow cast by the Moon which fully or partially blocks (“occults”) the Sun. This can only happen when the Sun, Moon and Earth are nearly aligned on a straight line in three dimensions (syzygy) during a new moon when the Moon is close to the ecliptic plane. In a total eclipse, the disk of the Sun is fully obscured by the Moon. In partial and annular eclipses, only part of the Sun is obscured.
If the Moon were in a perfectly circular orbit, a little closer to the Earth, and in the same orbital plane, there would be total solar eclipses every new moon. However, since the Moon’s orbit is tilted at more than 5 degrees to the Earth’s orbit around the Sun, its shadow usually misses Earth. A solar eclipse can only occur when the moon is close enough to the ecliptic plane during a new moon. Special conditions must occur for the two events to coincide because the Moon’s orbit crosses the ecliptic at its orbital nodes twice every draconic month (27.212220 days) while a new moon occurs one every synodic month (29.530587981 days). Solar (and lunar) eclipses therefore happen only during eclipse seasons resulting in at least two, and up to five, solar eclipses each year; no more than two of which can be total eclipses.
Total eclipses are rare because the timing of the new moon within the eclipse season needs to be more exact for an alignment between the observer (on Earth) and the centers of the Sun and Moon. In addition, the elliptical orbit of the Moon often takes it far enough away from Earth that its apparent size is not large enough to block the Sun entirely. Total solar eclipses are rare at any particular location because totality exists only along a narrow path on the Earth’s surface traced by the Moon’s full shadow or umbra.