The Kiel and Delitzsch Commentary on the Old Testament quoted below is quite good and lengthy in explaining this:
Exo 4:21
“In thy going (returning) to Egypt, behold, all the wonders which I have put into thy hand, thou doest them before Pharaoh.” מֹופֵת, τὸ τέρας, portentum, is any object (natural event, thing, or person) of significance which surpasses expectation or the ordinary course of nature, and excites wonder in consequence. It is frequently connected with אֹות, σημεῖον, a sign (Deu4:34; Deu6:22; Deu7:19, etc.), and embraces the idea of אֹות within itself, i.e., wonder-sign. The expression, “all those wonders,” does not refer merely to the three signs mentioned in Exo4:2-9, but to all the miracles which were to be performed by Moses with the staff in the presence of Pharaoh, and which, though not named, were put into his hand potentially along with the staff. - But all the miracles would not induce Pharaoh to let Israel go, for Jehovah would harden his heart. את־לבּו אחזּק אני, lit., I will make his heart firm, so that it will not move, his feelings and attitude towards Israel will not change. For אחזּק אני or וחזּקתּי (Exo 14:4) and מחזּק אני (Exo 14:17), we find אקשׁה אני in Exo 7:3, "I will make Pharaoh's heart hard, or unfeeling;” and in Exo 10:1, הכבּדתּי אני "I have made his heart heavy,” i.e., obtuse, or insensible to impressions or divine influences. These three words are expressive of the hardening of the heart.
The hardening of Pharaoh is ascribed to God, not only in the passages just quoted, but also in Exo9:12; Exo10:20, Exo10:27; Exo11:10; Exo14:8; that is to say, ten times in all; and that not merely as foreknown or foretold by Jehovah, but as caused and effected by Him. In the last five passages it is invariably stated that “Jehovah hardened (יְהַזֵּק) Pharaoh's heart.” But it is also stated just as often, viz., ten times, that Pharaoh hardened his own heart, or made it heavy or firm; e.g., in Exo7:13, Exo7:22; Exo8:15; Exo 9:35, לב ויּחזק "and Pharaoh's heart was (or became) hard;" Exo7:14, לֵב כָּבֵד “Pharaoh's heart was heavy;” in Exo9:7, ל יִכְבַּד; in Exo8:11, Exo8:28; Exo9:34, אֶת־לִבֹּו וַיַּכְבֵּד or וְהַכְבֵּד; in Exo13:15, פ הִקְשָׁה כִּי “for Pharaoh made his heart hard.”
According to this, the hardening of Pharaoh was quite as much his own act as the decree of God. But if, in order to determine the precise relation of the divine to the human causality, we look more carefully at the two classes of expressions, we shall find that not only in connection with the first sign, by which Moses and Aaron were to show their credentials as the messengers of Jehovah, sent with the demand that he would let the people of Israel go (Exo7:13-14), but after the first five penal miracles, the hardening is invariably represented as his own.
After every one of these miracles, it is stated that Pharaoh's heart was firm, or dull, i.e., insensible to the voice of God, and unaffected by the miracles performed before his eyes, and the judgments of God suspended over him and his kingdom, and he did not listen to them (to Moses and Aaron with their demand), or let the people go (Exo7:22; Exo8:8, Exo8:15, Exo8:28; Exo9:7). It is not till after the sixth plague that it is stated that Jehovah made the heart of Pharaoh firm (Exo9:12). At the seventh the statement is repeated, that “Pharaoh made his heart heavy” (Exo9:34-35); but the continued refusal on the part of Pharaoh after the eighth and ninth (Exo10:20, Exo10:27) and his resolution to follow the Israelites and bring them back again, are attributed to the hardening of his heart by Jehovah (Exo14:8, cf. Exo14:4 and Exo14:17).
This hardening of his own heart was manifested first of all in the fact, that he paid not attention to the demand of Jehovah addressed to him through Moses, and would not let Israel go; and that not only at the commencement, so long as the Egyptian magicians imitated the signs performed by Moses and Aaron (though at the very first sign the rods of the magicians, when turned into serpents, were swallowed by Aaron's, Exo7:12-13), but even when the magicians themselves acknowledged, “This is the finger of God” (Exo8:19). It was also continued after the fourth and fifth plagues, when a distinction was made between the Egyptians and the Israelites, and the latter were exempted from the plagues, - a fact of which the king took care to convince himself (Exo9:7). And it was exhibited still further in his breaking his promise, that he would let Israel go if Moses and Aaron would obtain from Jehovah the removal of the plague, and in the fact, that even after he had been obliged to confess, “I have sinned, Jehovah is the righteous one, I and my people are unrighteous” (Exo9:27), he sinned again, as soon as breathing-time was given him, and would not let the people go (Exo9:34-35).
Thus Pharaoh would not bend his self-will to the will of God, even after he had discerned the finger of God and the omnipotence of Jehovah in the plagues suspended over him and his nation; he would not withdraw his haughty refusal, notwithstanding the fact that he was obliged to acknowledge that it was sin against Jehovah. Looked at from this side, the hardening was a fruit of sin, a consequence of that self-will, high-mindedness, and pride which flow from sin, and a continuous and ever increasing abuse of that freedom of the will which is innate in man, and which involves the possibility of obstinate resistance to the word and chastisement of God even until death. As the freedom of the will has its fixed limits in the unconditional dependence of the creature upon the Creator, so the sinner may resist the will of God as long as he lives. But such resistance plunges him into destruction, and is followed inevitably by death and damnation. God never allows any man to scoff at Him. Whoever will not suffer himself to be led, by the kindness and earnestness of the divine admonitions, to repentance and humble submission to the will of God, must inevitably perish, and by his destruction subserve the glory of God, and the manifestation of the holiness, righteousness, and omnipotence of Jehovah.
But God not only permits a man to harden himself; He also produces obduracy, and suspends this sentence over the impenitent. Not as though God took pleasure in the death of the wicked! No; God desires that the wicked should repent of his evil way and live (Eze33:11); and He desires this most earnestly, for “He will have all men to be saved and to come unto the knowledge of the truth” (1Ti2:4, cf. 2Pe3:9). As God causes His earthly sun to rise upon the evil and the good, and sendeth rain on the just and the unjust (Mat5:45), so He causes His sun of grace to shine upon all sinners, to lead them to life and salvation. But as the earthly sun produces different effects upon the earth, according to the nature of the soil upon which it shines, so the influence of the divine sun of grace manifests itself in different ways upon the human heart, according to its moral condition.
(Note: “The sun, by the force of its heat, moistens the wax and dries the clay, softening the one and hardening the other; and as this produces opposite effects by the same power, so, through the long-suffering of God, which reaches to all, some receive good and others evil, some are softened and others hardened.” - (Theodoret, quaest. 12 in Ex.)
The penitent permit the proofs of divine goodness and grace to lead them to repentance and salvation; but the impenitent harden themselves more and more against the grace of God, and so become ripe for the judgment of damnation. The very same manifestation of the mercy of God leads in the case of the one to salvation and life, and in that of the other to judgment and death, because he hardens himself against that mercy. In this increasing hardness on the part of the impenitent sinner against the mercy that is manifested towards him, there is accomplished the judgment of reprobation, first in God's furnishing the wicked with an opportunity of bringing fully to light the evil inclinations, desires, and thoughts that are in their hearts; and then, according to an invariable law of the moral government of the world, in His rendering the return of the impenitent sinner more and more difficult on account of his continued resistance, and eventually rendering it altogether impossible.
It is the curse of sin, that it renders the hard heart harder, and less susceptible to the gracious manifestations of divine love, long-suffering, and patience. In this twofold manner God produces hardness, not only permissive but effective; i.e., not only by giving time and space for the manifestation of human opposition, even to the utmost limits of creaturely freedom, but still more by those continued manifestations of His will which drive the hard heart to such utter obduracy that it is no longer capable of returning, and so giving over the hardened sinner to the judgment of damnation.
This is what we find in the case of Pharaoh. After he had hardened his heart against the revealed will of God during the first five plagues, the hardening commenced on the part of Jehovah with the sixth miracle (Exo9:12), when the omnipotence of God was displayed with such energy that even the Egyptian magicians were covered with the boils, and could no longer stand before Moses (Exo9:11). And yet, even after this hardening on the part of God, another opportunity was given to the wicked king to repent and change his mind, so that on two other occasions he acknowledged that his resistance was sin, and promised to submit to the will of Jehovah (Exo9:27., Exo10:16.). But when at length, even after the seventh plague, he broke his promise to let Israel go, and hardened his heart again as soon as the plague was removed (Exo9:34-35), Jehovah so hardened Pharaoh's heart that he not only did not let Israel go, but threatened Moses with death if he ever came into his presence again (Exo10:20, Exo10:27-28). The hardening was now completed so that he necessarily fell a victim to judgment; though the very first stroke of judgment in the slaying of the first-born was an admonition to consider and return. And it was not till after he had rejected the mercy displayed in this judgment, and manifested a defiant spirit once more, in spite of the words with which he had given Moses and Aaron permission to depart, “Go, and bless me also” (Exo12:31-32), that God completely hardened his heart, so that he pursued the Israelites with an army, and was overtaken by the judgment of utter destruction.
Now, although the hardening of Pharaoh on the part of Jehovah was only the complement of Pharaoh's hardening of his own heart, in the verse before us the former aspect alone is presented, because the principal object was not only to prepare Moses for the opposition which he would meet with from Pharaoh, but also to strengthen his weak faith, and remove at the very outset every cause for questioning and omnipotence of Jehovah. If it was by Jehovah Himself that Pharaoh was hardened, this hardening, which He not only foresaw and predicted by virtue of His omniscience, but produced and inflicted through His omnipotence, could not possibly hinder the performance of His will concerning Israel, but must rather contribute to the realization of His purposes of salvation and the manifestation of His glory (cf. Exo9:16; Exo10:2; Exo14:4, Exo14:17-18).
From -- Kiel and Delitzsch Commentary on the Old Testament regarding Exodus 4:21