The two brothers appear before Pharaoh to request the freedom of their people, but Pharaoh refuses to liberate them. As a consequence, terrible plagues are set upon Egypt. These plagues are sent to punish Pharaoh and to force him to free the Israelites. Free will is a fundamental principle of Judaism. No one forces, preordains, or impels a person to act.
People do as they wish to do.
Each is absolutely free to perform any deed, be it bad or good. If Pharaoh had repented sincerely at any point, his repentance would have been accepted, and he would have been spared any further suffering. However, even after the first five plagues, when Pharaoh said he would free the people, he was not repenting he made the offer of freedom only because he could not bare the suffering of the plagues. Pharaoh's coldness, his apathetic insensibility was used by God so that all subsequent ages could derive a knowledge and conviction of the Almightiness, the Presence, and the Direction of God in human history. Never again would there be a necessity for miracles.