Luke records Jesus’ birth, the shepherds’ visit, and Jesus’ circumcision which was when Simeon and Anna prophesied about Jesus’ ministry. These accounts are laden in the saving grace through Jesus to all including the Gentiles. He does not record the wise men visit nor Jesus’ need to be taken to Egypt to escape Herod’s wrath. Matthew does not record Luke’s recorded events, and Luke does not mention Matthew’s recorded events. Why?
First, consider the timing. How long was Jesus in Egypt? Jesus was born in either 6 or 5 B.C. Matthew records that the wise men started their trip when they saw the star in their homeland. The trip would have taken around a year. Thus, they visited Jesus, Joseph, and Mary when he was between one and two years old. (This is also why Herod had all the boys killed two and under, Matthew 2:16.) Matthew records that Joseph left Egypt “after Herod died”. Herod died in 6 B.C. So, their stay in Egypt was less than a year. And all the events in Luke and Matthew can easily fall into a timeline.
Now, as to why they recorded what they did. One reason is that they didn’t know about the other events. However, I believe another reason is more probable. Matthew’s reason for recording Jesus’ brief stay in Egypt as a toddler was to demonstrate how Jesus fulfilled Scripture. Matthew’s audience was Jews who wanted to know how Jesus fulfilled the Scriptures. So, Matthew recorded the visit to document it. It can be concluded that Joseph intended to keep his family in Bethlehem, as they had been there for around two years. However, God intervened because Jesus needed to be raised in Nazareth to fulfill Scriptures. God told the prophets to proclaim centuries before about the events of the young boys dying, Jesus being brought out of Egypt, and being raised as a Nazarene.
Luke’s audience was the Greek (intellectual Gentiles). They weren’t interested in how Jesus fulfilled scripture. Rather, they wanted to know the facts of how Jesus brings God’s grace. (Luke 1:1) Luke appealed to their reason and Matthew appeals to man’s religious incline. Both reveal Jesus in different ways according to the audience they had in mind.

