More precisely, they tried to determine the difference of longitude between two places. The difference of longitude is the difference in local times at the places. While local time is easy to determine by astronomical observations, there is no simple way of comparing time at different locations. Moon eclipse is one such mean. The principle was clear from the antiquity, and this was the principal method of practical determining of difference in longitude between distant places, until the discovery of Jupiter satellites, which have two advantages: their eclipses occur more frequently, and also their eclipse times are easier to predict with high accuracy.
EDIT. One cannot use a Sun eclipse for this purpose. The difference is that Moon's eclipse occurs at a definite time, which can be predicted. So if one
observer observes it at his local time $T_1$, and another at his local time $T_2$ then the difference of longitude it $T_1-T_2$.
Sun eclipses occur at times which depend on locations.