People determine whether or not they will love God and follow Him or follow their own dictates.
God knew that Pharaoh would not change the same way Christ knew the Pharisees would never accept Him (and He allowed them to be "blinded").
As St. Augustine said, "God will not save us without us" so it puts the choice clearly in our hands.
As to the Egyptian slaves "having to die" -- we will never know whether with each individual soul it was an act of His justice or His mercy -- and quite frankly it really is none of our concern. "For who has known the mind of the Lord, or who has been His counsellor?"
The truth is that God deals with us as individuals and not collectively. At the end, we will be either examples of His mercy or His justice.
We choose that.