“Exodus, right at the start, announces that the currently enslaved and oppressed Israel is none other than ‘my firstborn son’ (4:22). This, too, is where Matthew’s Gospel begins. The son of David, son of Abraham, son of Mary is also ‘my Son, whom I love; with him I am well pleased’ (Matt. 1:1, 16; 3:17). Yet Jesus’ life, like the existence of Israel, was threatened by the contemporary political authorities, and, like them, he even made the journey into and out of Egypt (Matt. 2:13–15). He too was subjected to adversity and satanic opposition (Matt. 4:1–11).
“Just as Israel left Egypt and came to the Red Sea (Exod. 14), Matthew immediately follows the account of Jesus’ return from Egypt (the only reference he makes to the boyhood of Jesus) with his coming to the Jordan for baptism (Matt. 2:23; 3:1). Just as Israel emerged from the Red Sea to go into the wilderness (Exod. 15:22), so Jesus went from the waters of baptism into the wilderness (Matt. 4:1). Israel experienced in turn absence of water and food (Exod. 15:23; 16:3), as did Jesus during his first temptation (Matt. 4:1–4). Israel came to the place where they put the Lord to the test (Exod. 17:2), something that Jesus refused to do in his second temptation (Matt. 4:7). Israel arrived at Mount Sinai (Exod. 19) where, promptly, they turned from the Lord to worship an idol (Exod. 32:1–6), whereas, by contrast, looking on all the kingdoms of the world from a ‘very high mountain’ Jesus insisted that only the Lord is to be worshipped (Matt. 4:8–10).
“In other words, Exodus is the story of the son of God who stands in need of salvation, failing at every point of life and even of privilege; Matthew tells of the Son of God who brings salvation (Matt. 1:21), perfect and righteous at every point and in every circumstance and test.”
Source: Motyer, J. A.. The Message of Exodus: The Days of Our Pilgrimage (The Bible Speaks Today Series) (p. 23). InterVarsity Press. Kindle Edition.