The slavery in Egypt is approaching its final stages. The ten plagues are beginning to descend upon a hapless Egypt. Though Pharaoh’s reactions are not spontaneous – his reversals and broken promises were foreordained – still, men of free and not pre-determined will, often emulate him.
It was after the second plague, Pharaoh had assured Moses that Israel would be freed, and the plague was in fact lifted. “But when Pharaoh saw that there was a respite, he hardened his heart” and repudiated his pledge. His promises were forgotten when the pressure was removed.
In case of sickness or some other calamity people will remind themselves of G-d. Religion and G-d are frequently kept in reserve, like resources to be used only in the most desperate need, when all other means are exhausted. In case of sickness or some other calamity people will remind themselves of G-d, and will contritely resolve never again to forget. There is no doubt that their faith and promises are honest and thoroughly sincere, but they are unproven as yet.
G-d is a refuge in distress, but not if He is otherwise ignored. Pharaoh set the example of promising to do good when he was suffering from a plague, but he promptly “hardened his heart when there was a respite.” The time of respite, that is the test of faith. Suffering, desperation, and calamities may impel one toward religion and G-d, and they can well mean the start of a truly religious life. But the person whose religion is in direct proportion to his suffering is an apt pupil of Pharaoh, hardly a worthy teacher.
D’var Torah courtesy of Chabad.org