Hashem said to Moshe (11:1) ָבִיאא ָדֶחא נֶגַע עוֹד ַיִםִצְרמ ַלוְע ַּרְעֹהפ ַלע, "I will bring one more plague upon Pharaoh and upon Mitzrayim..." It seems that makas Bechoros had two purposes: for Pharaoh and for Mitzrayim.
Reb Shimon Sholom of Amshinov zt'l explained that פרעה represents the tumah of avodah zarah, for it is known that Pharaoh made himself an avodah zarah (see Rashi Shemos 7:15). He said (Yechezkel 29:3) ֲנִיוַא יְאֹרִי לִי ַרָמא ֶרֲׁשאִנִיִיתֲׂשע, "My river is my own, and I made myself." ַיִםִצְרמ represents the tumah of arayos (forbidden marriages) because ַיִםִצְרמ is called ֶרְוַתעֶץָרָאה (see Bereishis 42:9). Hashem said, ָדֶחא נֶגַע עוֹד ַיִםִצְרמ ַלוְע ַּרְעֹהפ ַלע ָבִיאא, one more makah to break the kelipos of avodah zarah and of arayos. As we wrote above from the Baal Shem Tov, the purpose of the makos was mostly for Bnei Yisrael to know Hashem. Here, too, the primary objective was to purify the Jewish nation from these sins and tumos. As the Zohar (vol.2 p.36.) explains the pasuk (Yeshayah 19:22) ורפוא נגוף מצרים את 'ה ונגף, "Hashem shall plague Mitzrayim, plaguing and healing." The Zohar explains that each makah was a plague for Mitzrayim and a cure for the Yidden. Because in addition to being a punishment for Mitzrayim, the makos healed and taught lessons to Bnei Yisrael. As we explained, פרעה is avodah zarah and ַיִםִצְרמ represents ֶץָרָאה ֶרְוַתע, the aveiros of arayos. The makos were to teach Bnei Yisrael to improve in these areas.
A wise person, a tzaddik, shared with me a beautiful thought. We understand that Klal Yisrael needed to be purified from the tumah of arayos, but why did they need to be purified for avodah zarah? Who was so foolish as to worship idols? Pharaoh said לִיִנִיִיתֲׂשע ֲנִיוַא יְאֹרִי, implying that he thought he created the Nile and that he created himself. No rational thinking Yid would ever think such a thing (unless he needs to be locked up in an asylum)! So why did the Jews need the makah to cleanse them from avodah zarah?
The answer can be found in Rashi's commentary on Yechezkel (29:3) on the wordsִנִיִיתֲׂשע ֲנִיוַא יְאֹרִי לִי "My river is my own, and I made myself." Rashi writes, צריך איני .יאורי לי צרכי כל מספיק יאורי לי יש כי לעליונים. Translation: "I don't need heaven because I have the Nile for all my needs." He was saying that he doesn't need Heaven to give him rain and water because he has the Nile. He also said, הגדלתי ובחכמתי בגבורתי .עשיתני ואני וממשלתי גדולתי. Translation: "With my wisdom and strength, I became great and made my kingdom powerful." Once again, Pharaoh thought that he, with his wisdom and strength, built up his kingship in Mitzrayim, and he didn't realize that everything was from Hashem.
The Midrash (Osiyos d'Reb Akiva) writes, "Pharaoh said to Moshe and Aharon, 'You say Hakadosh Baruch Hu brings rain, I don't need His help, I already have the Nile River." Such thinking can creep into our minds as well. These thoughts are a mild form of avodah zarah because it is believing in one's ability and believing in nature. Even the Jewish nation needs chizuk in these matters. With makas Bechoros, Hashem brought the Jewish nation to clearly recognize and undoubtedly know that everything is from Hashem. Even when things appear to happen naturally or with the strength of man, everything is from Hashem alone.
Hashem said to Moshe (Shemos 10:1-2) ֶלא בֹּא ַיאֹתֹת ִיִׁתש ַןַעלְמ ָיוָדֲבע ֵבל ֶתוְא לִבּוֹ ֶתא ִּיִכְבַּדְתה ֲנִיא כִּי ַּרְעֹהפִּיַלַּלְתְעִתה ֶרֲׁשא ֵתא ָבִּנְך ֶןוּב ָבִנְך ָזְנֵיבְּא ֵּרַפְּסת ַןַעוּלְמ ,ִרְבּוֹבְּק ֵלֶּהא 'ה ֲנִיא כִּי ֶּםְתַעוִיד ָםבִּיְתַמׂש ֶרֲׁשא ַיאֹתֹת ֶתוְא ַיִםִצְרבְּמ, "Come to Pharaoh, for I have hardened his heart and the heart of his servants, in order that I may place these signs of Mine in his midst. And in order that you tell into the ears of your son and your son's son how I made a mockery of the Egyptians, and [that you tell of] My signs that I placed in them, and you will know that I am Hashem."
What "mockery" did Hashem perform in Mitzrayim? The Ramban writes .התעללתי וטעם בו הנקמות ועושה לבו את מכביד שאני ,בו מצחק אני כי, "The mockery was that I made a joke of Pharaoh because I strengthened his heart and took revenge on him." Pharaoh thought it was his decision when he said he wouldn't let the Yidden out of Mitzrayim, but it wasn't his choice. As the pesukim tell us, Hakadosh Baruch Hu hardened Pharaoh's heart and the heart of his servants. When the time of redemption arrived, Hashem turned Pharaoh's heart around, and he wanted to send the Yidden out of Mitzrayim. Pharoah was like clay in Hashem's hands, which was the mockery that Hashem made of Pharaoh. Pharaoh thought he was in control, but he wasn't.