"And the king of Egypt died"
Rabbi Yehoshua of Sachnin explains that God did not remember or hear the prayers of Yisrael until the time when the supernal minister of Egypt fell from power, as signified by the title verse.
Egypt represents our negative and wicked character traits, and Egypt's minister or King is the root seed of our evil. When we offer up our negative traits by admitting them to ourselves during prayer and meditation and to others during moments of conflict, our prayers then ascend to the Upper World. The act of acknowledgment is the key that unlocks the gates of heaven so that all our prayers will be answered.
As we recall our most vile traits in this moment, and peruse the text of the Zohar, we eradicate the root level of all evil in ourselves, and in this world. All our prayers for peace, endless joy, and eternal life are henceforth answered.
340. "And it came to pass in the course of those many days" (Shemot 2:23). Rabbi Yehoshua of Sachnin said it was at the end of their exile that Yisrael were subjugated with all kinds of labor. "In the course of those many days." They were many in THE SOJOURN OF Yisrael in Egypt, MEANING THAT THE END HAD ARRIVED. Since the end of their exile was complete, it is written, "And the king of Egypt died" (Ibid.). What is the meaning? IT IS that the Minister of Egypt was lowered from his high position and fell from his glory. THEREFORE, THE TORAH SAYS ABOUT HIM, "AND THE KING OF EGYPT DIED," SINCE HIS DESCENT WAS CONSIDERED BY HIM AS DEATH. Since the king of Egypt who was their minister fell, the Holy One, blessed be He, remembered Yisrael and heard their prayers.
340. וַיְהִי בַיָּמִים הָרַבִּים הָהֵם. רִבִּי יְהוֹשֻׁעַ דְּסַכְנִין אָמַר, וַיְהִי בַיָּמִים הָרַבִּים הָהֵם, סוֹף גָּלוּתָם הָיָה, שֶׁהָיוּ יִשְׂרָאֵל מְשׁוּעֲבָּדִים בְּכָל עֲבוֹדָה. בַּיָּמִים הָרַבִּים הָהֵם, שֶׁהָיוּ רָבִּים לְיִשְׂרָאֵל בְּמִצְרַיִם, וְכֵיוָן שֶׁנִּשְׁתַּלַּם קֵץ גָּלוּתָם, מַה כְּתִיב, וַיָּמָת מֶלֶךְ מִצְרַיִם. מ"ט. שֶׁהוּרַד שַׂר מִצְרַיִם מִמַּעֲלָתוֹ, וְנָפַל מִגַּאֲוָתוֹ. וְכֵיוָן שֶׁנָּפַל מֶלֶךְ מִצְרַיִם, שֶׁהוּא שַׂר שֶׁלָּהֶן, זָכַר הַקוּדְשָׁא בְּרִיךְ הוּא לְיִשְׂרָאֵל, וְשָׁמַע תְּפִלָּתָם.
341. Rabbi Yehuda said, Come and behold. As RABBI YEHOSHUA OF SACHNIN SAID, as long as the minister held sway over Yisrael, the cries of Yisrael were not heard. But as soon as their minister fell, it is written, "And the king of Egypt died." Immediately, "the children of Yisrael sighed by reason of their bondage, and they cried, and their beseeching rose to the Elohim" (Ibid.). BUT until that time, their beseeching was not answered.
341. אָמַר רִבִּי יְהוּדָה, בֹּא וּרְאֵה שֶׁכַּךְ הוּא, שֶׁכָּל זְמָן שֶׁהַשַּׂר שֶׁלָּהֶם נִתְנָה לוֹ שְׂרָרָה עַל יִשְׂרָאֵל, לֹא נִשְׁמַע צַעֲקָתָם שֶׁל יִשְׂרָאֵל, כֵּיוָן שֶׁנָּפַל הַשַּׂר שֶׁלָּהֶם, כְּתִיב וַיָּמָת מֶלֶךְ מִצְרַיִם, וּמִיָּד וַיֵּאָנְחוּ בְּנֵי יִשְׂרָאֵל מִן הָעֲבוֹדָה וַיִזְעָקוּ וַתַּעַל שַׁוְעָתָם אֶל הָאֱלֹהִים. שֶׁעַד אוֹתָהּ שָׁעָה לֹא נַעֲנוּ בְּצַעֲקָתָם.