It matters not whether this was a real history, or only a parable to represent the common practices of men in such cases.
Related Commentaries of Ecclesiastes 9:14
Ecclesiastes 9:14
14 There was a little city, and few men within it; and there came a great king against it, and besieged it, and built great bulwarks against it: