This is indeed a difficult thing to understand and it takes some serious discipleship to deal with it. This is a stumbling block for new Christians. They have to trust G-d until they get to know Him better and understand both how He operates and how He speaks before they are truly comfortable with it.
Methinks most of us go to our grave with questions about this one.
Since the answer is not simple, I will not try to present my limited understanding of the whole thing nor why I have come to that understanding. Here is a short version.
If I threaten my son with something too small, I actually encourage him to disobey. You could say I harden his heart. But if I go directly to the punishment that is sufficiently harsh to cause him to obey, he would call me unjust because I had not given him an opportunity to do well with a lighter threat. So, which should I do? The just step-by-step approach which gives him the chance to do well before the punishment is severe or simply jump to where I know I will wind up, skipping the preliminaries.
Pharoah was not going to let the Israelites go until the death of his son. That's what it was going to take all along. The smaller measures only served to cause Pharoah's heart to harden. G-d took responsibility for that because G-d knew that would be the result. But who realy did the hardening? G-d or Pharoah?
In the end, Pharoah had the full choice to let the Hebrews go whenever he wished. Pharoah takes the full blame for the destruction of Egypt.
But G-d knew it would happen, and the merciful G-d did not lay all the blame on Pharoah. The merciful G-d also provided a way for Pharoah to be with Him in Heaven. His name is Jesus.
Do you know Him?
Shalom.
Maybe, but consider this...I would have had a lot more confidence in Moses on the day of departure if I had witnessed all of plagues and works God had wrought. The Red Sea would have sealed the deal for me. Then I could have made that long hike.