ויהי חשך אפלה: שלשת ימים. ...וְלָמָּה הֵבִיא עֲלֵיהֶם חֹשֶׁךְ? שֶׁהָיוּ בְיִשְׂרָאֵל בְּאוֹתוֹ הַדּוֹר רְשָׁעִים וְלֹא הָיוּ רוֹצִים לָצֵאת, וּמֵתוּ בִשְׁלוֹשֶׁת יְמֵי אֲפֵלָה, כְּדֵי שֶׁלֹּא יִרְאוּ מִצְרִיִּים בְּמַפַּלְתָּם וְיֹאמְרוּ, אַף הֵם לוֹקִים כָּמוֹנוּ...
ויהי חשך אפלה … שלשת ימים — ...And why did He bring darkness upon them? Because there were wicked people amongst the Israelites of that generation who had no desire to leave Egypt, and these died during the three days of darkness so that the Egyptians might not see their destruction and say, “These, (the Israelites) too have been stricken as we have”...
חֹשֶׁךְ לָמָּה? יִתְבָּרַךְ שְׁמוֹ שֶׁל מֶלֶךְ מַלְכֵי הַמְּלָכִים הַקָּדוֹשׁ בָּרוּךְ הוּא, שֶׁאֵין לְפָנָיו מַשּׂוֹא פָּנִים, וְהוּא חוֹקֵר לֵב וּבוֹחֵן כְּלָיוֹת. לְפִי שֶׁהָיוּ בְּיִשְׂרָאֵל פּוֹשְׁעִין שֶׁהָיָה לָהֶם פַּטְרוֹנִין מִן הַמִּצְרִים, וְהָיָה לָהֶם שָׁם כָּבוֹד וָעֹשֶׁר וְלֹא הָיוּ רוֹצִין לָצֵאת מִמִּצְרַיִם, אָמַר הַקָּדוֹשׁ בָּרוּךְ הוּא: אִם אֲנִי אָבִיא עֲלֵיהֶן מַכָּה בְּפַרְהֶסְיָא וְיָמוּתוּ, יֹאמְרוּ הַמִּצְרִים, כְּשֵׁם שֶׁעָבַר עָלֵינוּ, כָּךְ עָבַר עֲלֵיהֶן. לְפִיכָךְ הֵבִיא עַל הַמִּצְרִים אֶת הַחֹשֶׁךְ שְׁלֹשָׁה יָמִים, וְלֹא רָאוּ אִישׁ אֶת אָחִיו...
Why was darkness inflicted upon them? Because the King of Kings, the Holy One, blessed be He, shows no partiality, and searches the heart and tries the kidneys of all. He brought darkness upon them because there were sinners in Israel who had Egyptian patrons, and enjoyed honor and wealth, and were unwilling to leave. And the Holy One, blessed be He, said: If I bring a plague upon them in broad daylight, from which they will die, the Egyptians will say that just as it passed over us, so does it pass over them. Hence, He brought darkness upon the Egyptians for three days, and they saw not one another (ibid., v. 23)...
And I know what you’re thinking, because I was thinking the same thing when I first learnt this. “The people I know are smarter than that, it was only a very small number of people who thought this way.” And to that I remind of how Beshalach, next week’s parsha, starts by telling us that the jews were “chamushim” when they went up from Mitzrayim.
And the children of Israel went up armed (Exod. 13:18). This suggests that only one out of five (hamishah) went up armed (hamushim). However, others say: Only one out of fifty (hamishim) went up, while still others insist that only one out of every five hundred (mihamesh) went up. R. Nehorai declared: By the Temple service! [An idiomatic exclamation with the sense of “By God!”] Not even one out of five thousand went up. When had the others died? During the days of darkness, they would bring their dead for burial while the Egyptians sat in darkness. The Israelites praised Him and thanked Him (for the fact) that their enemies were unable to see their misfortune and take satisfaction in it.
תניא רבי סימאי אומר נאמר (שמות ו, ז) ולקחתי אתכם לי לעם ונאמר והבאתי אתכם מקיש יציאתן ממצרים לביאתן לארץ מה ביאתן לארץ שנים מס' ריבוא אף יציאתן ממצרים שנים מס' ריבוא
It is taught in a baraita with regard to the few that are destined to be redeemed: Rav Simai says that it is stated: “And I will take you to Me as a people” (Exodus 6:7), and juxtaposed to that verse it is stated: “And I will bring you into the land” (Exodus 6:8). The Torah compares their exodus from Egypt to their entry into the land; just as during their entry into the land only two of six hundred thousand entered the land, as they all died in the wilderness except for Caleb and Joshua, so too, during their exodus from Egypt, in terms of the ratio, only two of six hundred thousand left Egypt and the rest died there.