The moon orbits the Earth. The Earth -moon combination orbits the Sun. Sometimes the Sun, Earth and moon are lined up, meaning that either the Earth or moon is at least partially in the shadow of the other. These instances are called eclipses. If the Moon passes between the Earth and the Sun then it is a solar eclipse (the Sun is eclipsed from the Earth), and if the Earth is between the moon and the Sun then it is a Lunar eclipse (the moon is eclipsed by the Earth)..
A solar eclipse does not cover the whole Earth in shadow, as shown below. There are regions of partial shadow – penumbra - where the Sun is only partially blocked by the moon, and a region of total shadow – umbra - where the light from the Sun is (almost) totally blocked by the moon.
As the Earth turns, the moon casts a shadow which describes a strip over the Earth's surface.