Because Earth rotates on its axis from west to east, the Moon and the Sun (and all other celestial objects) appear to move from east to west across the sky. Viewed from above, however, the Moon orbits Earth in the same direction as our planet rotates. So, the Moon actually moves from west to east through our sky, albeit so slowly that we almost never notice it.
During a total solar eclipse, however, we can see the Moon’s true motion as it crosses the Sun’s face from west to east. As this occurs, the Moon’s shadow follows it — moving in the same direction — and tracks a path across Earth’s surface.
NASA has created a helpful video, “Flying Around the Eclipse Shadow,” which illustrates this geometry if you’re still having trouble picturing it. You can watch it online at https://svs.gsfc.nasa.gov/4579.