Another interpretation: A LITTLE CITY (Ecclesiastes 9:14) — this is the wilderness; AND FEW PEOPLE IN IT — this is the generation of the wilderness; AND A GREAT KING CAME AGAINST IT — this is the Holy One, blessed be He; AND BUILT GREAT SIEGE WORKS AGAINST IT — when? At the hour when Israel made the calf. For what is written (in Deuteronomy 9:14)? “Let Me alone, that I may destroy them.” NOW THERE WAS FOUND IN IT A POOR AND WISE MAN (Ecclesiastes 9:15) — this is Moses the righteous, as it is said (in Proverbs 21:22), “A wise man scaled the city of the mighty.” AND HE DELIVERED THE CITY BY HIS WISDOM — as it is said (in Exodus 32:11), “Why, O LORD, should Your wrath burn against Your people?” BUT NO ONE REMEMBERED THAT POOR MAN — the Holy One, blessed be He, said: If a man did not remember him, I remember him, as it is said (in Isaiah 63:11), “Then He remembered the days of old, Moses [and] His people.”
Moses the Poor Wise Man Who Saved the City of the Wilderness
Midrash Tanchuma Buber, Vayigash 1:3
ד"א עיר קטנה זה המדבר, ואנשים בה מעט זה דור המדבר, ובא אליה מלך גדול זה הקב"ה, ובנה עליה מצודים גדולים אימתי בשעה שעשו ישראל את העגל, מח כתיב הרף ממני ואשמידם (דברים ט יד) ומצא בה איש מסכן וחכם, זה משה הצדיק, שנאמר עיר גבורים עלה חכם (משלי כא כב), ומלט הוא את העיר בחכמתו, שנאמר למה ה' יחרה אפך בעמך (שמות לב יא), ואדם לא זכר את האיש המסכן ההוא, אמר הקב"ה אם אדם לא זכרו אני זוכרו, שנאמר ויזכר ימי עולם משה (עבדו) [עמו] (ישעיה סג יא).