God explained the purpose of the plagues to Pharaoh. They were meant to show that no one is like God in the entire world (9:14; see also Isaiah 46:9; Jeremiah 10:6–7). God did not destroy Pharaoh and Egypt in one strike, even though he could have. Instead, he spared them (Exodus 9:16).
God gave them a chance to recognize his power. But Pharaoh refused to humble himself and continued to oppress the Lord's people (9:17).