This simile emphasizes the people should leave their cities and live in the rocky cliffs to hide from their enemies. (See: [[rc://en/ta/man/translate/figs-simile]])
Here "mouth of a hole" is an idiom that means the entrance to a cave. AT: "the entrance to caves" or "an opening in the rocks" (See: [[rc://en/ta/man/translate/figs-idiom]])