A solar eclipse happens when the Moon passes in front of the Sun and casts a shadow across Earth.
For a total eclipse to take place, the sun, moon and Earth must be in a direct line. The second type of solar eclipse is a partial solar eclipse. This happens when the sun, moon and Earth are not exactly lined up. The sun appears to have a dark shadow on only a small part of its surface.
The reason is because it takes a long time for the light from the stars in the sky to reach earth, so the light the star was producing millions of years ago has just now reached Earth.