The Moon’s orbit intersects Earth’s orbit around the Sun — the ecliptic — at two points called nodes. When this intersection occurs very near to when the Sun, Moon, and Earth all align, we get an eclipse. Three factors affect the slope of a solar eclipse’s path of totality: the distance of the Moon from the node, Earth’s season, and whether the eclipse occurs at the ascending or descending node.
How far our satellite is from the node when the three bodies align affects the path. Basically, this means that all eclipse paths don’t begin at the same latitude. The Moon’s umbra, or shadow, can intersect Earth anywhere between its north and south poles. As a general rule, however, the paths of any two eclipses falling on a certain date and which track through the same hemisphere will appear similar.
Regarding the seasons, the general rules say that if we’re talking about eclipses when the Moon’s position is relatively close to the node, then eclipses occurring within two months of the September equinox tend to have central paths running northwest to southeast. Likewise, eclipses occurring within two months of the March equinox tend to have central paths running southwest to northeast.
Eclipses occurring at the ascending node (when the Moon crosses the ecliptic heading northward) tend to move generally northeast. Those at the descending node tend to move from northwest to southeast.
So, although the 2017 and 2024 eclipses both occur at the ascending node, the 2017 event is within two months of the September equinox, while the 2024 one is close to the March equinox. That’s why the Moon’s shadow moves in different directions.