(Exodus 10:21:) "Stretch out your hand toward the heavens." The Holy One, blessed be He, brought the plagues upon them in the battle-order of a king of flesh and blood. A king of flesh and blood, when a province rebels against him, what does he do? He sends out legions, and they surround it. At first he dams up their water-channel; if they turn back, well and good, but if not, he brings war-cries against them. [And if they turn back, well and good, but if not, he shoots arrows at them; if they turn back, well and good, but if not, he brings legions against them; if they turn back, well and good, but if not, he brings spear-fighters against them;] if they turn back, well and good, but if not, he hurls naphtha at them; if they turn back, well and good, but if not, he flings catapult-stones at them; and if they turn back, well and good, but if not, he stirs up against them a great host of troops; if they turn back, well and good, but if not, he binds them in the prison-house; if they turn back, well and good, but if not, he kills the great ones among them. So too the Holy One, blessed be He, came upon the Egyptians in the battle-order of kings. At first He dammed up their water-channel, as it is said (Psalms 78:44): "He turned their rivers into blood, so that they could not drink of their streams." And they did not turn back, so He brought war-cries upon them—these are the frogs, as it is said (Exodus 8:8): "concerning the matter of the frogs," etc. And they did not turn back, so He brought the arrows upon them—these are the lice, as it is said (Exodus 8:13): "And there was lice [upon man and upon beast]," for it would enter into the body of the Egyptian like an arrow. [And they did not turn back, so He brought legions upon them—this is the swarm of wild beasts, as it is said (Psalms 78:45): "He sent among them swarms of flies, which devoured them." And they did not turn back, so He brought spear-fighters upon them—this is the pestilence.] And they did not turn back, so He hurled naphtha at them—this is the boils. And they did not turn back, so He flung catapult-stones at them—this is the hail. And they did not turn back, and afterward He stirred up against them a great host of troops—this is the locusts. And afterward He put them in the prison-house [this is the darkness], as it is said (Exodus 10:21): "And there shall be darkness," etc. And they did not turn back, so He killed all the great ones among them, as it is said (Exodus 12:29): "And the LORD smote all the firstborn."
Why the Ten Plagues Followed a King's Siege Order in Egypt
Midrash Tanchuma Buber, Bo 4:1
נטה (את) ידך על השמים (שמות י כא). בטכסיס [מלך] בשר ודם הביא הקדוש ב"ה עליהם את המכות, מלך בשר ודם כיון שהמדינה מורדת עליו, מה עושה משלח לגיונות, והן מקיפין עליה, בתחילה הוא (שובר) [סוכר] אמת המים שלהם, אם חוזרין מוטב, ואם לאו הוא מביא עליהם קלנים, [ואם חוזרין מוטב, ואם לאו יורה בהן חצים, אם חוזרין מוטב, ואם לאו מביא עליהם, לגיונות, אם חוזרין מוטב, ואם לאו מביא עליהם דורמסיות], אם חוזרין מוטב, ואם לאו זורק בהם נפט, אם חוזרין מוטב, ואם לאו משליך בהם, אבני בליסטרא, ואם חוזרין מוטב, ואם לאו מגרה בהן (לגיונות ו) אוכלסין הרבה, אם חוזרין בהם מוטב, ואם לאו אוסר אותן בבית האסורין, אם חוזרין מוטב, ואם לאו הורג את הגדולים שבהם, כך הקב"ה בא על המצרים בטכסיס של מלכים, בתחילה (שבר) [סכר] אמת המים שלהן, שנאמר ויהפך לדן יאוריהם ונוזליהם בל ישתיון (תהלים עח מד), ולא חזרו הביא עליהם קלנים, אלו הצפרדעים, שנאמר על דבר הצפרדעים וגו' (שמות ח ח), ולא חזרו הביא עליהם את החצים, אלו הכנים, שנאמר ותהי הכנם [באדם ובבהמה] (שם שם יג), שהיתה נכנסת בגופו של מצרי כחץ הזה, [ולא חזרו הביא עליהן לגיונות זה ערוב שנאמר ישלח (בם) [בהם] ערוב ויאכלם (תהלים עח מה), ולא חזרו הביא עליהם דורמסיות, זה הדבר], ולא חזרו זרק בהן נפט זה השחין, ולא חזרו השליך בהן אבני בליסטרא, זה הברד, ולא חזרו ואחר כך, גירה בהן אוכלוסין הרבה, זה הארבה, ואחר כך נתנם בבית האסורים [זה החשך] שנאמר וימש חשך וגו' (שמות י כא), ולא חזרו והרג כל הגדולים שבהן, שנאמר וה' הכה כל בכור (שם יב כט).