Solar eclipses are not actually rarer than lunar eclipses – in fact, they occur in about equal numbers, usually about two of each per year.
For example, between 2000BC to 3000AD there will be 11,898 solar eclipses and 12,064 lunar eclipses. However, at any one location on Earth, it is much less common to see a solar eclipse than a lunar one. And the reason for this is entirely due to geometry.
A lunar eclipse, when the Moon moves through the shadow of the Earth, is visible from wherever the Moon is above the horizon, which is over half of the Earth. However, when the Moon appears to move in front of the Sun during a solar eclipse, the shadow cast by the Moon is much smaller than Earth. It’s only about 480km (300 miles) wide when cast onto the Earth’s surface.
Solar eclipses are therefore only visible from within a narrow path across the Earth, making it difficult to get to a location to see one. This is why they are visible less often from any given location.