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, and if the Earth is between the moon and the Sun then it is a lunar eclipse.
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.