I have found that the birth stories of Jesus in the gospels of Matthew and Luke are just fabrications made by their respective writers to convince the readers that Jesus was born in Bethlehem to make it appear he fulfilled prophecy.
That is because the birth stories in the gospels of Matthew and Luke grossly contradict each other. Because of that, it is clear they are fabrications.
According to Matthew the family of Jesus lived in Bethlehem when Jesus was born during the reign of Herod the Great (Herod died in 4 B.C.). Matthew relates of a threat to Jesus and a trip to Egypt and that, when they returned to Palestine after the death of Herod, the family of Jesus bypassed their original home in Bethlehem and settled in Nazareth so that Jesus would fulfill a prophecy (a prophecy that is non-existent in the Old Testament, by the way).
According to Luke, Joseph and Mary lived in Nazareth before the birth of Jesus and went to Bethlehem during the Syrian governorship of Cyrenus (that's the Greek spelling; Quirinius is the Latin, and he began his governorship in 6 A.D.) because of an enrollment for taxes that required that everyone had to go to the city of their ancestors. Not long after the birth of Jesus the family returned to their home in Nazareth.
In attempting to reconcile the two accounts, apologists try to place the enrollment for taxation mentioned in Luke to the time of Herod the Great's reign. However, there was no such enrollment during that time. The Romans taxed only the provinces they had direct control of, such as Egypt and Syria. They did not tax the provinces controlled by client rulers such as Herod the Great.
Furthermore, there is no evidence that there was a Roman enrollment for taxation in Judea during Herod's reign, and attempts to prove otherwise are without basis. In addition, Saturninus was Governor of Syria from 9 BC to 6 BC, and Varus from 6 BC until after the death of Herod. Again, Quirinius was not governor of Syria until 6 A.D.
When Herod died in 4 BC, the Romans divided up his territory of Palestine and gave Judea, Idumea, and Samaria to his son Archelaus to rule, and the other parts of Palestine to his other two sons. Archelaus was brutal as ruler and his subjects appealed to Rome. As a result, Rome deposed Archelaus in 6 AD and took over direct rule of Archelaus's territory. In so doing they instituted taxation of that territory, and Quirinius, as the newly installed governor of Syria, was tasked to oversee the taxation, hence the enrollment.
That taxation did not include Galilee, which was ruled by Herod's son Antipas, so Joseph, as a resident of Galilee (according to Luke's story) would not have been required to go to Bethlehem for the enrollment. (Contrary to Luke's exaggeration, the taxation was not world wide and did not require everyone to return to the city of their ancestors. The practical Romans would never have required such a return because there would have been absolutely no reason for it, and it would have disrupted commerce. The Romans taxed on the basis of residency, not ancestry). But Luke needed to make up a way to get Joseph and Mary to go to Bethlehem in Judea where Jesus would be born, so he exaggerated and changed the requirements for the enrollment as a device to accomplish that.
In Matthew's story, Joseph originally lived in Bethlehem, and that some time after the birth of Jesus, Herod posed a threat to Jesus. Joseph and his family therefore went to Egypt (which Matthew made up to appear to fulfill prophecy), returning after the death of Herod. Using the brutal reign of Archelaus as an excuse, Matthew had Joseph and his family bypass their home in Bethlehem and instead settle in Nazareth. As the KJ Bible says, "And he came and dwelt in a city called Nazareth: that it might be fulfilled which was spoken by the prophets, He shall be called a Nazarene." That indicates that Joseph was making a new home for himself and his family there. Again, there was no such prophecy. Matthew just made it up to give a reason for Joseph to settle in Nazareth.
Near the beginning of his story, Luke refers to "Herod King of Judea" (Luke 1:5), which would have been Herod Archelaus, not Herod the Great (upon their father's death, both Archelaus and Antipas took on their father's name as a title for themselves). Herod the Great, referred to in Matthew, was king of all of Palestine, not just Judea.
It seems that Luke was familiar with the history of Palestine and he used that history as the framework for his fabrication of the birth story of Jesus. In that context, it is therefore clear that the events described in chapter one of his gospel were supposed to have occurred near the end of Herod Archelaus's reign (which I described above), and that the beginning of chapter two is referring to events just after Archelaus was deposed and the Romans took direct rule over Judea and initiated the enrollment for taxation. Because he wove his fabricated story into the historical events, the time frame of Luke's story is therefore self-consistent, and the attempts by apologists to place Luke's story during Herod the Great's reign are without foundation. Thus the contradiction with Matthew's fabricated account still exists.
Luke continues his story in chapter two by relating that Joseph and Mary traveled from their home in Nazareth to Bethlehem because of the enrollment for taxation. Not long after their arrival in Bethlehem, Jesus was born, and after performing the ritual requirements according to the law of Moses, which was forty days, Joseph and his family returned to their home in Nazareth.
There is simply no way that the two fabricated stories can be reconciled.