Matthew tells us the life of Jesus “fulfills” something spoken by the prophet Hosea. Yet Hosea is not “predicting” anything; Hosea is looking backward to the Exodus. What is Matthew doing? He’s pointing out the theological connection between Israel as God’s son and the Messiah, God’s son.
The first third of the book of Exodus takes place in Egypt. The Israelites had lived in Egypt for 400 years and were steeped in Egyptian culture. The cultural and historical setting of Exodus is ancient Egypt. Here’s a brief introduction.