Matthew 2 | Jesus Life Parallels the History of Israel
The theme of the Gospel of Matthew is that Jesus is King. Through His signs and teachings, He proves Himself to be the Messiah, the Son of David, the Son of Man, the Lord of the Sabbath, and God. Matthew 2 shows Jesus' early life parallels the history of Israel to eventually show that Jesus is Perfect Israel.
Remember that the Gospel of Matthew is structured around five of Jesus’ sermons/discourses, much like the Book of Deuteronomy is structured as sermons. Jesus seems to be showing that He is the prophet greater than Moses. However, more than that, Matthew continually refers to Old Testament prophecies that Jesus fulfills, proving that He is the Messiah, the Son of David, the Son of Man, and (most importantly) God.