We learn about the Torah and Haftara readings for Rosh HaShana in the Talmud, Megilla 31a:
On the first day we read “And God remembered Sarah” and conclude with the Haftara of Chana. The next day we read “And God tested Avraham” and conclude with the Haftara which contains the verse “Is Efraim not a precious son to me (Yirmiyahu 31:19).”
Rashi explains that we read the Haftara from Yirmiyahu on Rosh HaShana since the last verse includes the words “remember” and “compassion”:
Is Efraim not a precious son to me, a delightful child? Whenever I speak of him I remember him all the more. Therefore I long for him inwardly. I will show him great compassion, declares the Lord.
The Ran, Rabbeinu Nissim comments that this section is chosen as it says “zachor ezkerenu”, “I will remember him all the more” and one of the obligations of Rosh HaShana is to mention zichronot, remembrances.
This verse is also read as part of the Zichronot section of the Musaf service.
The Talmud, Rosh HaShana 32a explains that the Zichronot section is based on the verse from Bamidbar 10:10:
And on your days of rejoicing, your festivals and New Moons, you shall sound the trumpets over your elevation offerings and over your peace offerings. They will be a reminder of you before your God. I am the Lord your God.
The sound of the shofar does not only remind us to repent, it also reminds us of what it says in Yishayahu 27:13 which we read in the Shofarot section of Musaf:
It will be, on that day: a great ram’s horn will sound, and they will come, all those lost in the land of Ashur and those who are exiled in the land of Egypt, and they shall prostrate themselves to the Lord on the holy mount in Jerusalem.
Radak comments that in the final redemption, the shofar will be blown and the exiles will return from all over the world. This includes the ten tribes (known as Efraim) that were exiled to the other side of the river (Assyria) by the king of Ashur. They were exiled, lost, and never came back. In contrast, the tribes of Yehuda and Binyamin were exiled to Babylonia and returned after 70 years of exile. When they were exiled a second time, they were spread out all over the world.
Rav Yisachar Yakovson quotes Rav M. Hirsch who explains that the Haftara from Yirmiyahu about Efraim returning was chosen to remind us of the tribes who were exiled first and were subsequently lost. Most of the Jews today are from the tribe of Yehuda. We must not forget the other tribes who have not yet returned.
The ultimate Ingathering of the Exiles will include the entire nation- Efraim and Yehuda. Yirmiyahu describes what will happen (Yirmiyahu 31:6-8):
For this is what the Lord said: Sing joyously for Yaakov and shout publicly for the nations. Give voice, give praise, and say, “Lord, deliver Your people, the remnant of Israel.” I am about to bring them from the northern land and gather them from the ends of the earth…A great assembly will return here. They will come weeping, and with compassion I will lead them. I will guide them along streams of water on a level path upon which they will not stumble, for I have become a father to Israel, and Efraim is my firstborn.
We are living in miraculous times where we see the Ingathering of the Exiles on a daily basis with Jews returning to Israel from all over the world. On Rosh HaShana, we should keep in mind all of the Jews who would like to make aliya but can’t do so at this time due to their own personal reasons and hope that whatever impediments are in their way can be resolved.