"But you, O Bethlehem Ephrathah, who are too little to be among the clans of Judah, from you shall come forth for me one who is to be ruler in Israel, whose coming forth is from of old, from ancient days.”
This passage in Micah was written between 500 and 800 years before the birth of Jesus. While there is some disagreement among scholars regarding what parts were written when, it is accepted that it was completed at least 500 years prior to Jesus’ birth.
Mary may have rode a donkey on the journey. The Bible does not say, but donkeys were commonly used at that time.
Hundreds of years after the prophecy was made, an unlikely series of events had to occur in order for Jesus to be born in Bethlehem. Mary and Joseph lived in Nazareth and would have to travel 4-6 days to reach Bethlehem. It was no small ordeal to travel that distance with a woman who was close to delivering a baby and not something they would choose to do lightly.
What would cause them to do this?
God used the ruler of the Roman empire to orchestrate their travel plans. Caesar Augustus was not a godly person, but God used him and his actions to fulfill prophecies made hundreds of years earlier.
"In those days a decree went out from Caesar Augustus that all the world should be registered. This was the first registration when Quirinius was governor of Syria. And all went to be registered, each to his own town. And Joseph also went up from Galilee, from the town of Nazareth, to Judea, to the city of David, which is called Bethlehem, because he was of the house and lineage of David, to be registered with Mary, his betrothed, who was with child.”