In addition to the good thoughts in the comments on the previous post, I thought I should chime in here.
In a nutshell, I think we need to consider Matthew’s real world setting.
Matthew’s gospel was written decades after Jesus’ death and resurrection. Why is this important? For some simple reasons. Matthew, along with the other disciples, had heard the story of Jesus’ birth many times, as they spent time with Jesus’ mother before and after the resurrection. They were a group. They transmitted all these stories orally as they preached. When Matthew heard Mary, who “stored the events of the birth of Jesus in her heart,” tell the disciples about the miraculous circumstances of the birth of Jesus, including the trip to and back from Egypt, it clicked in his head – wow, the birth was a sign and a literal salvation all in one. He was instantly reminded of verses like Hosea 11:1 and the way that the messiah and the nation were identified with each other in his Bible elsewhere (the OT). Seeing the points of analogy, was led by the Spirit to note the connection in his gospel. There’s no need to view Hosea 11:1 as a prophecy that pointed to Jesus. Rather, a gospel writer saw an analogy and interpreted that analogy as something God intended to be made clear once messiah had come. We could consider it typology or a simple analogy. Either way, it made sense to Matthew and, I think, it isn’t hard for us now to see the sense of it. It’s not magic – it’s applying the very human circumstances of Matthew’s life to the issue and imagining that it would have taken very little (the birth story) for him to see analogous relationships — sort of like it worked in our heads the first time we realized that, in Scripture, the nation itself is also God’s son (see Exod 4:23) and servant (see the refs to “servant” in Isaiah – they are basically all corporate Israel except for Isaiah 53).