In this matter there have been two general lines of scholarly opinion, namely, that the citations gave rise to the infancy narrative, or that they are appended to a narrative that already existed….
Several factors favor the thesis that in chs. 1-2 Matthew added the citations to an already existing narrative. First, in a section like 2:13-23 it is extremely difficult to imagine how the narrative could ever have been made up by reflection on the three formula citations contained therein, since the citations deal with aspects that are only minor in the story line. The same may be said of the citation of Micah 5:1(2) in Matt 2:5b-6. Reflection on that citation might have caused a Christian to compose a story locating Jesus' birth at Bethlehem, but it could scarcely have led him to the narrative about the magi. Reflection on the LXX of Isa 7:14 (cited in Matt 1:22-23) might have caused a Christian to compose a story about Jesus' mother being a virgin, but it could scarcely have led him to compose a narrative wherein Joseph was the main figure.
Second, four of the five formula citations in the infancy narrative have a definite air of being appended. The reader should make the experiment of reading the stories in 1:18-25 and 2:13-23 omitting four of the formula citations (1:22-23; 2:15b; 2:17-18; 2:23b). The story line not only makes perfect sense without them but even flows more smoothly. The only citation that is woven into the plot is the one that is dubiously a formula citation (2:5b-6). This observation weakens even the more subtle form of the thesis that Matthew composed his narrative on the basis of the citations, for they are too tangentially related to the plot to have served as a nucleus in gathering fragmented traditions into a consecutive story.
Third, we have other instances of Matthew's appending formula citations to stories that already came to him. For instance, Mark 1:14 and Luke 4:14 agree that after his baptism Jesus went to Galilee, but only Matt 4:12-16 comments on this with a formula citation from Isa 8:23-9:1 (=RSV 9:1-2) which speaks of the land of Zebulun and Naphtali, toward the sea, Galilee of the Gentiles. Matthew prepared for the introduction of the citation by reporting not only that Jesus went to Galilee, but also that he went to Capernaum by the sea in the territory of Zebulun and Naphtali. The citation could not have caused Matthew to create the story of Jesus' going to Galilee - he had that in Mark - but it did cause him to color and adapt the Marcan narrative, so that the correspondence to the prophecy might be more obvious. We have a good analogy then for arguing that the same process occurred in the infancy narratives where we do not have a control coming from comparative Synoptic material….
We have a partial control in relation to the formula citation: "He will be called a Nazorean" (Matt 2:23). The citation did not cause Matthew to invent the information that Jesus' family dwelt "in a city called Nazareth." Such geographical information was part of the common Gospel tradition.
(The Birth Of The Messiah [New York, New York: Doubleday, 1999], 99-101, n. 8 on 101)
For more about the broader argument that the infancy narratives were derived from the Old Testament and ancient traditions about the Old Testament, see here.