Despite what the church says, there isn't one Christmas story in the Bible. There are two, and they're different.
Matthew is a strict Jew, writing for a Jewish audience. He hates the Pharisees, insists that the Law must be kept more strictly than they do, but who generally agrees with their interpretations. His Jesus is born in a Jewish context, to a family in Bethlehem (apparently they live there), in the reign of Herod I, who died in 4 BC. The first people to respond to the birth are Gentile astrologers, following a star.
The origin of the star is to be found in Numbers 24:17. A king called Balak has summoned Balaam, a pagan prophet, to curse Israel An angel intervenes, and Balaam is forced to bless them instead. He says that 'A star shall come out of Jacob, and a scepter shall rise out of Israel; it shall crush the borderlands of Moab, and the territory of all the Shethites.'
When devout Jews found themselves impoverished and oppressed in the last couple of centuries BC, they started to imagine that God would intervene decisively, to put things to rights. Either he would send a great angel, or a human king, the Messiah (messiah means 'anointed one'; the king was anointed at his coronation, and was sometimes called 'the Lord's anointed'). This king was symbolised by the star; the Dead Sea Scrolls use the passage in a messianic context.
Matthew envisages an essentially Jewish Kingdom, but there is plenty of room for Gentiles within it. There is no evidence that any Jew ever claimed that Gentiles would not find their place. So to emphasise this, Matthew presents Gentiles as the first people to respond to Jesus.
The astrologers go to Herod, expecting to see a royal baby. He knows nothing of the birth, and reacts angrily. He was a paranoid tyrant; Augustus allegedly said that 'It was safer to be Herod's pig than his son'. When he was dying, he had the sons of Jewish notables arrested, with orders that they should be killed as soon as he was dead, so that the Jews would mourn his passing. In the event, they were released unharmed. So, according to Matthew, Herod ordered the slaughter of all the children under two around Bethlehem. The massacre is not mentioned elsewhere.
Meanwhile, Mary and Joseph have been warned by an angel in a dream, and have run away to Egypt, where they live as refugees. Eventually, they return, believing it to be safe. However, Herod's son Archelaus now rules Judea and Samaria. After another dream, they move to Nazareth, where another of Herod's sons, Antipas, now rules.
Luke writes for Romanised Greeks, and is the most obviously Gentile of the Gospels. His Jesus is born immediately after the Romans establish direct control of Judea. Archelaus ruled as Ethnarch for about ten years, until Jewish complaints led to the Romans sending him into exile, and establishing direct rule.
Judea came under the Syrian Legate, the most senior Roman official after the emperor, who had responsibility for the entire eastern frontier as far as the border of Egypt. This was far too large an area for one man to control directly, so most of it had come under native princes who were subject to Rome. At the time, the Legate was a man named Quirinius. He visited Judea, and carried out a census, to determine the taxation base. This happened in late 6 or early 7 AD. In order to deny that there is a discrepancy between the two Gospels, some conservatives claim that Quirinius may have served as Legate twice. Unfortunately, this is based on a mistranslation of a partial inscription which does not include the mane of the governor it refers to. After the census was complete, a Prefect, drawn from the minor aristocracy, was appointed to govern Judea.
According to Luke, John the Baptist was born before Jesus, and was his cousin. He was born miraculously, to an elderly mother, under 'King Herod of Judea', ie Herod I. Six months later, ten years having been dropped from the story, unless Luke confused his Herods, an angel appeared to Mary announcing the birth of Jesus. She protested that she was too young (parthenos means 'a young woman', not necessarily 'virgin') but the angel reassures her. There is an undoubted virgin birth in Matthew, but Luke is ambiguous, and can be read either way. Both are concerned to say that the birth was miraculous.
The family live in Nazareth, but have to visit Bethlehem for the census, as this is where Joseph's family originated. This makes little sense. Roman taxation was based on where you lived, not where you ancestors lived, for obvious reasons. No system could handle that degree of chaos. Additionally, Galilee was ruled by Antipas, and taxes would have been paid to him, not to Rome. Both Matthew and Like have to cope with a tradition which said both that the Messiah was to come form Bethlehem, and that Jesus was from Nazareth. Luke's solution looks a little contrived!
So, according to Luke, Jesus was born in a stable in Bethlehem. There are no animals; they were added to the story later. Shepherds are the first to respond to the birth; Luke is greatly concerned for the poor.
So we have two rather different versions of the story, one for Jews, and one for Gentiles. In all probability, neither author had much to go on; very likely, nobody was sure of the exact year of Jesus' birth. But that doesn't matter; they weren't writing history. In fact, in our modern sense, history writing had not been invented. They were writing theology, in the form of story. Matthew writes for Jews at a very difficult moment of their history, and presents Jesus as a suffering Jew. Luke writes for Gentiles, and presents him as having been born into the Roman world, and as being recognised first by the poor. Both show him as the miraculous Son of God from the moment of birth.
After 2000 years, the church should be mature enough to take both stories seriously, with all the tensions between them, rather than smothering them with the saccharine nonsense of the traditional 'Christmas story'!