Solar eclipses happen when the moon moves between Earth and the sun. You might think that this should happen every month since the moon’s orbit, depending on how it is defined is between about 27 and 29 days long. But our moon’s orbit is tilted with respect to Earth’s orbit around the sun by about five degrees. Not much, you say? Yes, but the moon, itself, is only about ½ degree in width in the sky, about ½ the width of your pinky finger held at arm’s length. So, sometimes the moon misses too high and sometimes too low to cause a solar eclipse. Only when the sun, moon, and Earth line up close to the “line of nodes”, the imaginary line that represents the intersection of the orbital planes of the moon and Earth, can you have an eclipse.
This is true for both solar and lunar eclipses. This situation is somewhat unique as no other moon in the solar system orbits roughly in the plane of the “ecliptic”, Earth’s orbital plane, that the planets more or less follow.