John Gill's Exposition of the Whole Bible
Jeremiah 40:11
Likewise, when all the Jews that [were] in Moab,.... Who had fled thither, and to the places after mentioned, when the king of Babylon first invaded the land, and where they had continued unto this time:
and among the Ammonites, and in Edom, and that [were] in all the countries; in all other neighbouring countries, besides Moab, Ammon, and Edom; some fleeing one way, and some another, which lay nearest to their borders, or where they thought themselves safest: when they
heard that the king of Babylon had left a remnant of Judah; a few of their brethren, to cultivate the land, and repopulated it:
and that he had set over them Gedaliah the son of Ahikam the son of Shaphan; whom they knew to be a wise and good man; these were engaging motives to them to return to their own land, being more desirable to live in than any other, could they enjoy peace and safety; and to dwell with their brethren, their own countrymen, and of the same religion with them, was more eligible than to dwell in foreign idolatrous countries; and especially since there was a government established to protect and defend them, and that in the hands of so worthy a prince as Gedaliah.