The Rambam discusses the idea that a person who commits a great sin or many sins may not be allowed the chance to repent and be forgiven. This is because they have willfully and consciously committed these sins, and their repentance- "Teshuvah" is held back.
A person may commit a great sin or many sins causing the judgment rendered before the True Judge to be that the retribution [administered to] this transgressor for these sins which he willfully and consciously committed is that his Teshuvah will be held back. He will not be allowed the chance to repent from his wickedness so that he will die and be wiped out because of the sin he committed.
This is implied by the Holy One, blessed be He's statement [related] by Isaiah [6:10]: “Make the heart of this people fat [and make their ears heavy. Smear over their eyes, lest they see with their eyes... understand with their hearts, repent and be healed].”
Similarly, [II Chronicles 36:16] states “ They mocked the messengers of God, scorned His words, scoffed at His prophets until the anger of God mounted up against His people until there was no remedy.”
Implied [by these verses] is that they willingly sinned, multiplying their iniquity until it was obliged to hold back their Teshuvah, [which is referred to as] the "remedy."
For these reasons, it is written in the Torah [Exodus 14:4], "I will harden Pharaoh's heart." Since, he began to sin on his own initiative and caused hardships to the Israelites who dwelled in his land as [Exodus 1:10] states: "Come, let us deal wisely with them," judgment obligated that he be prevented from repenting so that he would suffer retribution. Therefore, The Holy One, blessed be He, hardened his heart.
Why did [God] send Moses to [Pharaoh], telling him: “Send [forth the people], repent”? The Holy One, blessed be He, had already told Moses that he would not release [the people], as [Exodus 9:30] states: “I realize that you and your subjects [still do not fear God].”
[The reason is stated in Exodus 9:16:] “For this alone, I have preserved you… so that My name will be spoken about throughout the earth],” i.e., to make known to all the inhabitants of the world that when the Holy One, blessed be He, withholds repentance from a sinner, he cannot repent, but he will die in the wickedness that he initially committed willfully.
It can be learned from the Rambam that the purpose of Pharaoh's sins, forewarnings, and hardening of heart amounted to inform and teach mankind the laws of repentance and their principles. As a result, we are obligated to delve into this matter to understand the knowledge God sought to inform us.
To understand the meaning of this verse(Exodus 10:1), we must examine its language:
ויאמר יהוה אל־משה בא אל־פרעה כי־אני הכבדתי את־לבו ואת־לב עבדיו למען שתי אתתי אלה בקרבו
Hashem said to Moshe, “come to Pharaoh for I have hardened his heart and [also] the hearts of his servants, so that I will be able to set [perform] these [miraculous] signs in their midst.
Why was 'I' added, and what would have happened if it was written 'Come to Pharaoh, for he hardened his heart?' Consequently, we can conclude, considering what we have said before, that the whole issue of repentance, In which we are brought up and taught, is not attributed to logic and reason, but rather it is an ordinance from God. Similarly, reference may be made to the well-known Talmudic teaching (Yerushalmi Makhot 2 halacha 6),
When they asked "wisdom," what is the punishment for a sinner, they said to them: "Sinners will be pursued by evil" (Proverbs 13:21). When they asked "prophecy," what is the punishment for a sinner, it said to them: "The soul that sins shall die" (Ezekiel 18:4). And when they asked the Holy One, blessed be He, what is the punishment for a sinner, He said to them: They should do repentance and be forgiven.
In other words, according to the reasoning of "wisdom" and the ways of "prophecy," there is no room for rectifying sin and repentance, and when a man sins, he is sentenced to eternal punishment. Nevertheless, ultimately God, in His great kindness, deviates from the line of justice as it appears in the words of "wisdom" and "prophecy" by offering the sinner a pathway to repentance. In light of this, it follows, now that we have reached this principle, that even man's lack of repentance, caused by hardened hearts and difficulties, is not caused by any individual but by God Himself since He is the one who gave this gift of repentance, outside of the line of justice and only He can take it away when he sees fit. As the Talmud stated (kesubos 16a), "The mouth that prohibited can permit." Accordingly, it can be argued that this is why the phrase is said, 'because I have hardened his heart' - 'I' is precise, that without God, there is no power and authority in anyone's hand to do this. (Indeed, in the course of our discussion, we will further explain the need for this verse.)