The solar system is rather flat, with all its major parts moving in nearly the same plane.
The path of the Sun across the celestial sphere is very close to that of the planets and the moon. During the cycle of the solar year, to observers on earth the sun appears to move month by month successively across twelve constellations positioned on the ecliptic plane called the Twelve Signs of the Zodiac. After clocks became available, it was a relatively straightforward job for astronomers to relate the path of the Sun in the daytime to the one of stars at night, and to draw it on their star charts. Because of its relation to eclipses, that path is known as the ecliptic.