Thales of Miletus purportedly predicted a solar eclipse (most likely the solar eclipse of May 28, 585 BCE). The historicity of Thales' prediction can't be verified with any certainty given the sparsity of written records documenting the pre-Socratic era that have survived to present day. So, putting the historical question of whether or not he did aside, what plausible answers are there to the question of how he could/would have made such a prediction?
I recently read the relevant parts of the Cambridge Concise History of Astronomy and I'd suggest it was partly good observation, partly luck.
Good observation in that Thales would have noted that the movements of the Sun and Moon were such that eclipses were possible on certain dates, and luck in that the shadow of the eclipse he suggested was possible passed over him or those to whom he had suggested the eclipse took place.
I very much doubt he had the observational data (about the size of the Earth for instance) to have been precise about the shadow path - but would have had the data to show when the Sun and Moon were in alignment.