It is recognised by everybody that "Out of Egypt I called my Son" (Matthew 2:15, quoting Hosea 11:1) has been one of the harder fulfilment passages Matthew's gospel. It is hard for several reasons.
1) Hosea 11:1 seems to be recalling a past event rather than anticipating a future event. This is noted by all the commentators. We misunderstand Matthew's use of "fulfilment" if we think that it means that it is a fulfilment of a predictive prophecy. Jesus is Israel. In being the seed in whom all the promises to Israel would be fulfilled, even the events of his life mirror the history of Israel. e.g. Blomberg, 67, "This is the first of several instances in Matthew in which Jesus recapitulates the role of Israel as a whole".
National Israel anticipated the life of the true vine, in whom the hopes and fear of all the years are met.
2) Matthew states that hosea 11:1 is fulfilled straight after he has recounted the journey of Jesus, joseph and Mary into Egypt, not out of it.
The majority of commentators (eg. Caron, Blomberg, Calvin, Nolland) suggest that it is put here rather than when he actually comes out of Egypt for structural reasons. Three scenes in 2:13-23 each fulfil one Old Testament allusion.
However, there is another possible (and I think probable) explanation. I first heard of it in a conversation with Michael Lawrence. I'd not arrived at Capitol Hill Baptist Church by the time he was at that point in his bible studies through Matthew's gospel. However, he explained to me how it makes perfect sense to see "Out of Egypt have I called my Son" to refer to Jesus' journey from Israel to Egpyt rather than the return journey.
Herod acts like Pharoah, even killing baby boys. Infanticide was seen as the most horrific of social crimes in the Old Testament. It is from such an Egypt that the Lord brought his son Israel in the Exodus.
Once you see this, there are all kinds of other parallels between the Exodus story and the flight to Egpyt that one sees. They flee at night (Exodus 12:8,12,29,30,31, 42) at the direct command of the Lord (Exodus 12:31). Both passages have the death of God's enemies front and centre: the one who seeks the death of God's people will die. In Exodus, there is no house without a dead son. In Matthew, the death of Herod himself is hightlight (2:15, 19, 20).
This fits also with the whole theme of Matthew's gospel. Jesus is the true Israel, and Israel is no longer the people of God, unless they recognise Jesus as their Messiah. See this theme recur here.
Then, if we have Jesus as our Messiah, even those who will not be comforted due to the exile caused by their rebellion, can in fact have the comforts of the New Covenant, hence the second quotation from Jeremiah 31.
however, these comforts come from the One who is despised and rejected. We deserve the exile; Jesus experiences exile his whole life, as he is called a Nazarene: the one who came unto his own, but his own received him not. Yet, to all who did receive him he, who believed in his name he gave the right to become children of God. (cf. John 1:11-12)