The opening Posuk in this week's Parsha presents a question raised by many commentators throughout the first few Parshiyos of Sefer Shemos. The Posuk states "כי אני הכבדתי את לבו," "for I have hardened Paroh's heart," (so that he won't let Bnai Yisrael out of Mitzrayim) in order to perform more wonders (meaning to give out more punishments) in Mitzrayim until Paroh lets the people go (שמות י:א). The question is how Hashem could harden Paroh's heart so that he wouldn't release the Jews and then go punish Mitzrayim with the plagues because of this. It would seem that Paroh (and his country) should be undeserving of any punishment because Hashem made him refuse to send out the Jews. How could Hashem punish Paroh for something that He made him do?
One answer, given by the Ramban, is that Hashem had to harden Paroh's heart in order to punish him for his previous sins. Paroh sinned by planning to put the Jews into slavery in the first place and then by adding on to them much unnecessary affliction. If Paroh would have done Teshuvah at that point, Hashem indeed wouldn't have punished him. Hashem thus had to harden Paroh's heart here to remove from him the option of Teshuvah so He could punish him for his previous sinful action against the Jews.
A second answer, given by Rashi, is that after Paroh had sinned against Hashem by mistreating the Jews, Hashem sent him the first five plagues to show him His strength and ability to punish. Paroh, however, didn't take these hardships as a hint to do Teshuvah and release the Jews. Only then, after Hashem had given Paroh ample time to do Teshuvah, does He tell Paroh that because he was stubborn and refused to do Teshuvah, He will now fulfill Paroh's wish to refuse to give in and guide him along the path he selected. Only then does Hashem harden Paroh's heart and consequently punish him. The first five Makkos should have been a sufficient hint for Paroh to start to do Teshuvah. Yet we see that after each of these plagues, Paroh himself refused to release the Jews and hardened his own heart. The references to Hashem hardening Paroh's heart refer only to the last five Makkos; Paroh did it himself after each of the first five. Hashem then had no choice other than to harden his heart and to punish him. Along the same lines, the Sforno says that this is the way of Hashem: He'd rather see a wicked person do Teshuvah first than simply punish or kill him. Hashem thus showed Paroh His greatness and His wonders in order to give him a chance to repent.
Rabbeinu Bachaya quotes a Midrash which says that from here we see how to answer a transgressor who says "I had no chance to repent." We show him that Hashem gave him ample opportunity to repent many times and he never did. After a while, Hashem closes the door of opportunity to repent because it's too late; one must be punished for our sins. This is exactly what Paroh experienced. He resisted repenting after the first five Makkos; only after his heart softened because the Makkos were getting harsher did he want to let the Jews out. By then, however, Hashem didn't want to listen; He thus hardened his heart and punished him. Hashem knew that Paroh's eventual readiness to let the Jews go wasn't out of his desire to listen to Hashem and do what He says, because if this were the case, He would've done so sooner. Rather, Hashem saw that this was just Paroh's plea to stop the punishments. Hashem did not accept this because Paroh now had to get the punishment he deserved. Therefore, Hashem hardening Paroh's heart wasn't an act of cruelty or injustice because He had already