The key to accurate longitude determination is synchronous time measurement around the globe. In contrast to solar eclipses, which are only seen in parts of the world and at different times, a lunar eclipse is observed at the same time everywhere and can therefore be used to synchronize time measurement across continents.
The Chinese method of longitude determination required a base observatory in China, which took observations of the same lunar eclipse that was observed at the place of unknown longitude. Observers at both locations identified a prominent star that passed through the celestial meridian at the very moment when the Moon started to reappear after the eclipse.
When the ship returned to China the two records were compared, and a new measurement was made to determine the time that elapsed between the passage of the two stars through the celestial meridian. As the Earth rotates around its axis once in 24 hours, a time difference of 1 hour between the two passages corresponds to 360/24 = 15 degrees of longitude.
Solar and lunar eclipses occur when the three bodies Sun, Earth and Moon are aligned in a plane. A solar eclipse is produced when the Moon blocks out part of the Sun. (If the Moon is in that location but not in the same plane as Sun and Earth it does not block out the Sun but is not visible against it; this occurs every fortnight and is known as New Moon.) The eclipse is experienced as the Moon's shadow travelling over the surface of the Earth. Because the Moon is so small, its shadow covers only a small part of the Earth and travels across the Earth's surface in a narrow band, where it is seen as a solar eclipse. Because solar eclipses appear at different times across Earth, they are not suitable for global synchronization of time.
Lunar eclipses occur when the Moon is in the shadow of the Earth. (If the Moon is in that location but not in the same plane as Sun and Earth this is known as Full Moon.) Because the Earth is much larger than the Moon, the period when it blocks the Sun's light from the Moon is experienced simultaneously over half the surface of the Earth.
An illustration of a lunar eclipse from an Arabic manuscript.