I think it is also interesting to note that the author of Matthew has absolutely no interest in the situation and scenario presumed by the prophecy in Micah 5:2....the only thing that counts is that "Bethlehem Ephrathah" is where the messiah (king of Israel) has his origin. It is worth considering what the presumed situation is in the original prophecy. Or situations, since the text bears evidence of multiple redactions that dramatically altered the prophesied scenario. Micah is clearly a composite work: the earliest chapters (ch. 1-3) date to the reign of Hezekiah and can be ascribed to the prophet Micah whereas the later chapters (ch. 4-7) reflect a much later time, with Babylon replacing Assyria as the enemy faced by Judah, and with the exile and restoration in view. It is however an open question of whether ch. 4-5 contain older material that was subsequently redacted by an exilic editor. There is indeed much evidence of reworking in this section (e.g. the switch from Assyria to Babylon in 4:10 and the switch back to Assyria in 5:5-6, the parenthetical comment in 5:3 that changes the subject of the verb between v. 2 and v. 4, the shift from "they" to "we" in 5:5 which ignores the fact that Yahweh is the one speaking, etc.), and there appears to be a kernal of material that does not presume an exile in Babylon and subsequent restoration. The prophecy pertaining to "Bethlehem Ephrathah" forms part of this earlier layer:
Micah 4:8-10b, 14, 5:2, 4-5a: "But you, O Migdal-Eder ["tower of the flock"], the refuge of the daughter of Zion, your former sovereignty shall return to you, kingship shall come back to the House of Israel. Why do you now cry aloud? Is there no king within you? Has your counsellor perished and has pain gripped you like that of a woman in labor? Writhe in agony, O daughter of Zion, and go into childbirth like a woman in labor, for now you must abandon the city and live in the open country. But you, O Beth-Ephrathah, the least of the clans of Judah, from you shall come forth for me the one who will rule over Israel, whose coming forth is from of old. And he shall stand and shepherd his flock in the strength of Yahweh, in the majesty of the name of Yahweh his God. They will live secure, for from then on he will extend his power to the ends of the earth, and he shall be their peace."
The situation presumed here fits very well with what is stated in ch. 1-3, written during Sennacherib's campaign in Judah in 701 BC. Micah accurately describes Sennacherib's campaign in the Shephelah and the Beer-sheba Valley in 1:8-16 but falsely predicts that the Assyrians would destroy Jerusalem (3:9-12). The surprise defeat of Sennacherib's army without battle was not something easily foreseen. The prophet Jeremiah tried to reckon with the failure of this prophecy by claiming that Yahweh had a change of heart and relented from the destruction that he had promised (Jeremiah 26:18-19). The kernal in ch. 4-5 would then represent the "original" conclusion to this prophecy. Jerusalem would be destroyed, the king (Hezekiah) killed or taken captive, and survivors (the daughter of Zion) would live in the devastated Judean hill country in despair. But these difficulties are described as the birthpangs that would lead to rise of a new king who would take power and restore the nation to its former glory. The geographical references here are important. The open country in the district of Ephrathah south of Jerusalem hosted the large flocks of sheep that provided the steady supply of animals sacrified at the Temple. Migdal-Eder is mentioned in Genesis 35:21 as a locality near to "Ephrath, that is Bethlehem" (v. 19), and likely referred to a fortification with an expansive view that was used to manage the flocks in the nearby hill country. The rural hill country would have likely been spared the destruction meted out to the towns along the major roads and Jerusalem (which is why Mark 13:14 parr. urges those in Judea to flee to the hills when Jerusalem is threatened), and it is this "open country" where survivors would have been found. Because this locality was used to raise sheep, this permits the prophet to metaphorically refer to the survivors as the "sheep" whom the new king would shepherd. Migdal-Eder, as a fortification, may well have been a refuge for potential survivors. That is why Beth-Ephrathah (as suggested by the LXX, or Bethlehem Ephrathah as it is in the MT) is mentioned in the passage. With Hezekiah and his son Manasseh killed or taken captive, the current royal dynasty would have come to an end. But there were others in the House of Ephrathah, many generations removed from David, who were potentially descendents and so it would be from this clan that one could arise to restore the Davidic kingdom.
Then in the exilic and early post-exilic periods the prophecy was heavily reworked to reflect the then-current situation of the exile: "You shall go to Babylon. There you shall be rescued; there Yahweh will redeem you from the hand of your enemies" (4:10c). Large sections were added to the oracle to describe the "remnant of Jacob" returning and instituting a universal worship of Yahweh (4:1-7, 5:7-15), a theme typical of early post-exilic works. The new scenario would thus be that Israel would return to the land and gather together like sheep in the open country and the Davidic dynasty would be resumed by a descendent from the House of Ephrathah. This accords very well with what was expected around 520 BC by the prophets Haggai and Zechariah concerning Zerubabbel, who would restore the House of David and Judean sovereignty. But history shows that those hopes were a failure as well. The messianic movement was not acceptable to Persian authorities and the satrap Tattenai likely ordered Zerubabbel (and the messianic pro-Davidide prophets) executed; he simply disappears from the narrative of Ezra after Tattenai asks ominously for a list of names (Ezra 5:4, 10). There is also an intriguing theory that the execution of Zerubbabel underlies the Suffering Servant figure in Deutero-Isaiah (Isaiah 52-53); cf. 52:9-11 concerning the carrying of the articles of the Temple from Babylon to the "ruins of Jerusalem", which fits what is said about Sheshbazzar and Zerubbabel (whether they are the same person or not) in Ezra. In any case, there never was again a Davidide who occupied the office of governor in the Yehud; the next governor Elnathan was a Davidide only by marriage (as he was married to Zerubbabel's daughter Shelomith). The author of Matthew then makes Jesus the true successor of the House of David, a descendent of Abihud the son of Zerubbabel (Matthew 1:13) — a name incidentally absent from the list of Zerubbabel's offspring in 1 Chronicles 3:19. Making Jesus born in Bethlehem attempts to fulfill the lingering expectation from Micah 5:2, if not in an overly literal way.