God gave Pharaoh multiple opportunities to do the right thing. Yet he disregarded them all: the moral case against slavery, Aaron's staff turning into a snake, the waters of the Nile turning to blood, frogs, gnats, flies, diseased cattle, boils, hail, locusts and thick darkness. Even after all of these plagues (warnings), the king continues to resist the Lord. There is only one thing left to do that will break Pharaoh's hard heart and cruel will: the death of the firstborn of all the Egyptians. The plague of death is coming.
We often act as if the worst possible outcome to befall a person is death, or experiencing the death of someone close to them. I don't want to downplay the agony of death and grief - it is indeed a horrible result of the Fall and its sin - but I also believe there are fates worse than death. After all, everyone reading this will one day die (should the Lord tarry), and everyone we know and love will also one day experience death. It is the way of all flesh. All of our lives are destined to end in unspeakable tragedy - if death is the worst of all possible worlds.
But...if your horizon extends farther than death, if you see that there are spiritual realities beyond this earth, then death is not the worst fate of all. The Bible speaks of Heaven and Hell. Everyone dies, but then there are only two possible destinations after that. Hell is the worst outcome of all. And - I believe - that what God was doing through the plagues upon Egypt was preparing His means of salvation, giving birth to the nation that would produce the Savior, so as to give people the opportunity to be spared from Hell and live with God forever in Heaven.
Can death ever be the means of deliverance? There is a reason that this account from Exodus is so deeply linked with the suffering and death of Jesus Christ. The stories line up in many fascinating ways. God may have allowed death to stalk the Egyptians in the tenth plague, but it is also a fate from which He did not spare even His own Son. In fact, it is through the death of Christ that we experience the newness of life.
What happened on a national scale between Moses and Pharaoh was replicated on the cross on a universal scale between God and Satan. Only this time, it was God's Son, His only Son, who died, so that others could live and be free.
God did nothing to Pharaoh that He wasn't willing to experience Himself, for the sake of the salvation of man.