"And it came to pass when Pharaoh stubbornly refused to let us go" (Exodus 13:15). From where do you say that when the Egyptians grew soft, Pharaoh grew hard? Scripture says, "And I will harden Pharaoh's heart" (Exodus 7:3). When Pharaoh grew soft, the Egyptians grew hard, as it says, "And I will harden the heart of Egypt." When both these and those grew soft, the Omnipresent strengthened their hearts, as it says, "For I have hardened his heart and the heart of his servants" (Exodus 10:1). "Therefore I sacrifice to the LORD all that opens the womb, the males, and every firstborn of my sons I redeem": what does this teach? From where do you say that if a man marries five virgin wives and they bear him five sons, he is obligated to redeem them all? Scripture says, "And every firstborn of my sons I redeem."
Pharaoh's Hardened Heart and Redeeming Every Firstborn Son
Mekhilta DeRabbi Shimon Ben Yochai 13:14
ויהי כי הקשה פרעה לשלחנו מנין אתה אומר כשמצרים מתרככין פרעה מתקשה ת"ל (ז' ג') ואני אקשה את לב פרעה: כשפרעה מתרכך מצרים מתקשין של ואני אקשה את לב מצרים: כשאלו ואלו מתרככין המקום מחזק לבם ת״ל (י' א') כי אני הכבדתי את לבו ואת לב עבדיו: על כן אני זובח לה' כל פטר רחם הזכרים וכל בכור בני אפדה. מה ת"ל מנין אתה אומר שאם נושא חמש נשים בתולות וילדו לו חמשה בנים שחייב לפדות את כולן ת"ל וכל בכור בני אפדה: