Beautiful as it is, the story of the birth of Jesus is a myth born of the political needs of early Christians.
The intended audience was probably internal. The early church needed celebrations to remind Christians who they were. Communion and baptism became the tools to remember the death of Jesus and his resurrection. The birth narratives were the perfect base for a celebration of his coming into the world.
What literary device was used by the authors?
Broadly speaking the authors were storytellers. They were not historians. Their work cannot be understood as history.
The birth narratives are properly called myths. A myth by definition is any story or report in which God or a God is the primary actor. Angels, free-moving stars, dreams, and unexplained bright lights are a part of the tools of mythology. Christians and the world at large have not been served well by attempts to read the birth narratives as history.
Just as many children feel deceived when they find out Santa is not real, many Christians feel deceived when they conclude that Jesus was not born of a virgin and that a star did not travel through the sky and come to rest over a particular place in Bethlehem.