The LORD said to Moses, “When you return to Egypt, see that you perform before Pharaoh all the wonders I have given you the power to do. But I will harden his heart so that he will not let the people go. Exodus 4:21
God desires that all come to repentance, even Pharaoh. But if God knows everything, then He knows whether Pharaoh will ever accept that opportunity. Pharaoh had plenty of chances to believe in God and rejected them his whole life, in favor of worshipping himself, since Pharaoh believed he himself was a god.
God may not have hardened Pharaoh’s heart by turning his “heart meter” from a soft 3 to a hard 10, but God did direct the events that caused Pharaoh to harden his own heart. That way, God influenced the hardening, yet Pharaoh chose the response. So Pharaoh had a chance to believe ten times and refused each demonstration of the power of God. It only took Pharaoh’s predecessor, 400 years before, with an interpretation of a dream to believe that Joseph’s God was the true God.
The harder Pharaoh’s heart grew in this story, the more amazing the story became. If Pharaoh relinquished after the blood red Nile, the story feels interesting, but not amazing. If God knew Pharaoh was a lost cause already (God is omniscient), why not magnify Pharaoh's disbelief to cause others to believe.
Remember, even the Pharisees rejected the miracles of Jesus and they had a front row seat to them!