Several scriptures in Exodus say, “I will harden his heart.” Exodus 4:21 is letting Moses know the outcome of the ten plagues before they even happen. Exodus 7:13 (and 7:22; 9:12,35) says, “He hardened Pharaoh’s heart that he hearkened not unto them, as the Lord said.” Note why Pharaoh’s heart was hardened – because he didn’t obey the Lord’s messenger and let the Israelites go. Pharaoh had an option he could have let Israel go much sooner than he finally did. God always respects free will.
Exodus 8:15 brings some clarity to the question. “But when Pharaoh saw that there was respite he hardened his heart and hearkened not unto them as the Lord had said.” It says Pharaoh hardened his own heart. Often Pharaoh would promise to let the people go and then change his mind. That is particularly true with the tenth plague with the death of the firstborn. He let the Israelites go and then pursued them to the sea and he and his army were destroyed.
The Lord wanted this particular Pharaoh ruling when it was time for Israel to leave. He had a proud, stubborn disposition that resisted the kindness of God in lifting the plague. Romans states he was stubborn (“harden” means stubborn in the Greek – Strongs # 4645) Romans 9:17-19 “…Even for this same purpose have I raised thee (Pharaoh) up, that I might shew my power in thee, and that my name might be declared throughout all the earth. Therefore hath he mercy on whom he will have mercy, and whom he will he hardens. Thou wilt say then unto me, Why doth he yet find fault? For who hath resisted his will?” In other words God provided the conditions and circumstances that demonstrated Pharaoh’s attitude as stubborn, cruel and unreasonable.
God had a purpose in all this. The plagues were aimed at the gods of Egypt and were designed to give proof of the power of the God of Israel over the false gods of Egypt. For example: the sun was a god; the Nile was a god; and they had a sacred bull cared for by a team of priest. Exodus 12:12 “against all the gods of Egypt I will execute judgment…”
Yes, God loves and wants all to be saved. “Who will have all men to be save and to come unto the knowledge of the truth.” (1 Timothy 2:4) “The Lord is not slack concerning his promise … not willing that any should perish, but that all should come to repentance.” (2 Peter 3:9) BUT this salvation is only for the willing. God does not force any.
Additionally, all will come to know the truth during Christ’s 1,000 year reign. Then the Bride of Christ (the Church class) will say, “Whosoever will, let him take the water of life freely.” (Revelation 22:17) As God said to Israel, “If you be willing and obedient you shall eat the good of the land.” (Isaiah 1:19)