A lot of people take issue with the fact that God hardened Pharaoh's heart. To many people, this seems unfair, and indeed it took me quite some time to fully understand this concept (the moral of that story being walk by faith, not sight, because there's always going to be something you don't understand).
The first thing to note is that Pharaoh was already hard hearted. God did not give Pharaoh a command only to physically force him to disobey, and as much as the Lord is said to have hardened his heart, so also is Pharaoh said to have hardened his own heart (Exodus 8:15, 32; 9:34). Pharaoh was thus an entirely willing participant in this hardening; a naturally hardened man. This is unsurprising, given that Pharaohs were actually considered to be gods themselves. Why would we be surprised that any human that would dare claim to be a god would also be very stubborn in defending that title against what he thought was just some random stutterer with a stick?
But still, why did God harden him so? After all, God is sovereign. He has the power to raise and defeat rulers, and of course, if He can harden hearts, He can also soften them. But what we see here is that God doesn't just want to take the Israelites out of Egypt. He wants the knowledge of God to be left in Egypt. In fact, God tells Pharaoh, through Moses, that the entire reason He raised him up was "...that I might show you my power and that my name might be proclaimed in all the earth." (Exodus 9:16b).
It was quite within God's power to send Moses to Pharaoh, command him to let Israel go, and have Pharaoh say "ok, that's cool, off you go." No fuss, no struggles, God is so great that He can actually guarantee that sin is never heard of again. And indeed, one day, sin will be a forgotten concept. All will obey God. Every knee will bow (Romans 14:11). But that would not have achieved His purpose. Who on the earth would bat an eye at a merciful ruler releasing his slaves? Some nations, rather than using it to see God's power, would see Egypt as being complete pushovers.
But what about a God who can pummel Egypt so hard that Pharaoh practically begs them to leave? A God so powerful that He can just turn a huge river to blood, switch off the sun on command, and strike down every firstborn in Egypt overnight? Wouldn't the whole earth tremble at such a God? Yes, without doubt, demonstrating His power would make all the earth fear it, as indeed it did.
Thus, by hardening Pharaoh's heart, the Lord proved who He is. His purpose was achieved, and to this very day, the 10 plagues are one of the most famous examples of the wrath of God. Through it, unbelievers have cause to repent, and believers have cause to trust God even when things look extremely bleak. Far from being proof that God is unfair, this is proof that God is more than capable of punishing sin and rescuing the oppressed.