Eclipses are caused when one space body is in front of another blocking the second one from receiving sunlight. There are two types of eclipses a solar eclipse and a lunar eclipse, in a solar eclipse the moon is between the sun and Earth, therefore Earth isn't receiving light. While in a Lunar eclipse it's the opposite Earth is blocking the sun rays from reaching the Moon. Eclipses aren't often but they do occur. Solar eclipses occur on a New moon when we don't see the moon, because the side receiving the light is the side pointing towards the sun, this also Blocks the Earth from receiving sun rays. In a Lunar eclipse it's the opposite except Earth is at 23.5 degrees on it's axis which means sometimes sunlight reaches the moon.
Ancient people didn't know what solar eclipses were, there was no explanation so they had to think of some, there were many and different people though of different things, One of the most popular thoughts was it was a dragon blocking the sun