Reference

Exodus 5:1–10, Exodus 7:1–12:14
Moses, the Plagues, and the Passover

In the Exodus story, when God delivered His people from Egypt, God went after gods of Egypt. He did so by sending ten plaques on Egypt, and the reason was to shame the false gods of Egypt and demonstrate His power over them. Therefore God sets His people free spiritually before He sets His people free physically.