Mary, who was pregnant, went with him. While they were in Bethlehem, the time came for her to deliver her baby. She gave birth to her first son, wrapped him in strips of cloth and laid him in a manger (a trough for animal feed) because there was no room for them in the inn.
In 31BC the Roman Empire was established under the control of Caesar Augustus. Palestine was part of this empire and Roman soldiers were stationed throughout the land. The main duty of the army was to maintain law and order, crush any rebellions against Roman rule and ensure taxes were collected. The Romans took a census every 14 years to count the population for the purpose of taxation. For a census, the men had to go to the town they were originally from. We know from ancient records that Quirinius governed Syria and held a census around the time Jesus was born.
Bethlehem was the birthplace of King David and also Joseph’s family town. The census brought Mary to Bethlehem as she accompanied Joseph, and so Bethlehem would be the birthplace of Jesus.