Principle
How do solar and lunar eclipses occur?
The moon rotates around the earth. If the moon is at a "suitable distance" between the earth and the sun, it "blocks" the light rays from the sun. This creates a shadow on earth. Thus a so-called solar eclipse develops. If the earth is now at a suitable distance between the sun and the moon, a lunar eclipse occurs. The earth blocks the light rays coming from the sun. This causes the earth to cast a shadow on the moon.