Pharaoh had no idea what he was doing resisting the Lord’s demand to release Israel, but Moses wrote,
But the Lord said to Moses,
“Pharaoh will not heed you, so that My wonders may be multiplied in the land of Egypt.” So Moses and Aaron did all these wonders before Pharaoh; and the Lord hardened Pharaoh’s heart, and he did not let the children of Israel go out of his land (Exodus 11:9–10).
Pharaoh’s failure to heed the Lord only gave the Lord more opportunities to demonstrate His power, but that was not a good thing for Pharaoh and Egypt. Even as the sun hardens clay, so the Lord hardened the heart of Pharaoh, and the plagues continued until they nearly destroyed Egypt.