The plagues were to demonstrate the legitimacy of I AM to the pagan pharaoh.