Exodus 12:12 states that the punishments were related to the heathen gods worshipped by the Egyptians (9 gods and Pharoh himself)
For I will pass through the land of Egypt this night, and will smite all the firstborn in the land of Egypt, both man and beast; and against all the gods of Egypt I will execute judgment: I am the LORD
Nile River (Exodus 7:14-25):
The Nile River was changed to blood. This plague was against the god Hapi, spirit of the Nile in flood and "giver of life to all men." The annual innundation was called "the arrival of Hapi" (57). He was especially worshipped at Gebel Silsileh and Elephantine. The Nile water was the transformed life-blood of Osiris. The fact that the Nile turned to blood, which was abominable to Egyptians, was a direct affront to one of their chief gods. Although the fish-goddess was Hatmeyt, all the fish in the Nile River died!
To illustrate the fact that the plagues of the Exodus were directed against the gods of Egypt, we note some Egyptian prayers to those gods. (The reference to "Nine Gods" apparently did not include pharaoh. It may be of interest that there were just nine plagues before God killed the first son of pharaoh.)
Praise to thee, 0 Nile, that issueth from the earth and cometh to nourish Egypt . . . That watereth the meadows, he that Ra hath created to nourish all cattle. That giveth drink to the desert places, which are far from water . . . When the Nile floodeth, offering is made to thee, cattle are slaughtered for thee, a great oblation is made for thee . . . Offering is also made to every other god, even as is done for the Nile, with incense, oxen, cattle, and birds upon the flame . . . All ye men, extol the Nine Gods, and stand in awe of the might which his son, the Lord of All, hath displayed, even he that maketh green the Two Riverbanks. Thou art verdant, 0 Nile, thou art verdant. He that maketh man to live on this cattle, and his cattle on the meadow . . ." (Adolph Erman, The Ancient Egyptians, 1966, p. 146.)
The Nile flooded every year, making the land fertile. If the Nile did not flood enough there was famine; if it flooded too much there was famine. The Nile was the lifeblood of Egypt, and thus it became one of their gods. Heathen gods often have some connection with the economics of daily life.
Frogs (Exodus 8:1-15):
The land was filled with them so that they became objects of loathing. The frog-headed goddess, Hekt (52, 62), played a part in "creation." Hers was one of the oldest fertility cults in Egypt. But she could not control the fertility of a these frogs! Through this plague they became a stench to the Egyptians.
Lice (Exodus 8:16-19):
At present there is no known link between this plague and a god of the Egyptian pantheon. However, the Egyptian magicians, unable to duplicate this plague, attribute it to "the finger of God" (Exodus 8:19), and they withdraw.
Underside of a heart scarab from the New Kingdom. It was laid on the heart of a mummy to ensure favorable testimony at the Judgment.
Flies, or Beetles ("insects" -- Exodus 20 - 32):
This plague may have been against Khephera, a scarab-headed (god regarded as a manifestation of Atum or Ra. It was supposed to be god of the resurrection, perhaps because the dung ball it rolled around, and in which it laid its egg, produced a "new creation." Priests wore scarabs as charms.
Or It may have been against the fly-god. One sorcerer in the New Kingdom threatened, "I will enter your body as a fly and see your body from the inside." As a symbol of bravery, soldiers who had proven themselves were decorated with the golden fly (52).
Murrain, or Anthrax (Exodus 9:1-7):
This judgment was against the bull god (revered as early as the Archaic Period (35), and the sacred cattle of Hathor, the cow-headed love goddess. It was a special reproach to pharaoh who worshipped Hathor. Hathor, whose name means "house of Horus," was sacred as early as the Old Kingdom (41, 58). Other gods associated with cattle were Ptah and Amon.
Great cemeteries of embalmed cattle have been excavated. The symbol of the bull was the symbol of pharaoh himself. In the "Hymn to Amon," it is difficult to distinguish the Pharaoh from the bull. The title is: "Adoration of Amunre (Amon-Ra), Bull of Heliopolus, chiefest of all gods, the good god, the beloved, who giveth life to all that is warm, and to every good herd."
Praise be to thee, Amunre, Lord of Karnak, who presideth in Thebes. Bull of his Mother, the first on his field! Wide of stride, first in Upper Egypt. . . . Greatest of heaven, eldest of earth, lord of what existeth, who abideth in all things. Unique in his nature among the gods, goodly bull of the Nine Gods, chiefest of all gods. Lord of Truth, father of the gods, who maketh mankind, and createth beast. (Erman, p. 283.)
Boils (Exodus 9:8-12):
Against the god of healing, Im-Hotep (69), an outstanding nobleman of the Old Kingdom. Although not actually deified until later than the time of the Exodus, he was no doubt revered at this time. But he could do nothing to help the Egyptians. The goddess Sekhmet was also known for her healing ability (106).
Hail (Exodus 9:13-15):
The sky goddess Nut was "the mother of the sun-god Ra, whom she swallowed in the evening and gave birth to again in the morning" (90). She was especially culpable in this plague in that she was supposed to protect the land from destructions which came down from heaven. Exodus 9:31 mentions that the flax and barley were hit. Destruction of the flax was trying because it was used to wrap mummies and to make clothes.
Grasshoppers, or Locusts (Exodus 10:1-20):
The locust-headed god was Senehem. During the plague, the locusts were so thick that the "eye of the earth" was darkened (Exodus 10:5). One of the epithets of the sun-god Ra was "the eye of Ra." By causing darkness while the sun was shining, Ra was discredited.
Darkness (Exodus 10:21-27):
One of the greatest gods of Egypt, next to the pharaoh, was the sun (65, 100, 118). The sun-god Amon-Ra was the principle deity of the pantheon. He made all growth possible. Pharaoh called himself "son of the sun." With three days of darkness, the principle deity was scorned. One of many hymns to the sun may help us feel their devotion to this deity:
Beautiful is thine appearing in the horizon of heaven, thou living sun, the first who lived. Thou risest in the eastern horizon, and fillest every land with thy beauty. Thou art beautiful and great, and glistenest, and art high above every land. Thy rays, they encompass the lands, so far as all that thou hast created. Thou art Ra, and thou reachest unto their end and subduest them for thy dear son [the Pharaoh]. Thou art afar, yet are thy rays upon the earth . . . etc., ad nauseum. (Erman, p. 289.)
In all the above, many other gods could have been named which were denigrated by the various plagues. But this sampling demonstrates that the Lord God Israel openly and violently, through his servants, put every one of them to shame.
Pharaoh (Exodus 11-12):
The last plague was not only against the supreme god of Egypt, Pharaoh himself, but also against the future pharaoh, his son, the very next god (Horus) of Egypt. He was to die on the same level as animals (not as a god), for the prophecy was that the firstborn of man and cattle would die.
Hymns of worship to many pharaohs have been found. Here is one to Rameses II:
The good god, the strong one, whom men praise, the lord, in whom men make their boast; who protecteth his soldiers, who maketh his boundaries on earth as he will. . . . (Erman, p. 258.)
Concerning the divinity of the pharaohs, William Edgerton notes:
As for the organization and powers of the government, everyone knows that the Pharaoh was an absolute monarch and that his authority rested theoretically on his supposed divinity. He is constantly called"the good god." One of his most frequent titles designates him as the son of the sun-god Ra, and we know that his claim of divine parentage was not a mere figure of speech; it was meant to be taken literally. Theoretically, of course, the Pharaoh's right-to-rule rested on his divinity. He was begotten by the sun-god Amon-Ra, who took the form of the previous king for this purpose, and Amon-Ra with the enthusiastic approval of the other gods placed him on the throne and decreed a long and brilliant reign for him. No doubt those theological fictions helped to strengthen the Pharaoh's position. But the really solid basis of his power was his control of the machinery of government, including the army and police. (Edgerton, Journal of Near Eastern Studies: 6, 1967, pp. 153-4.)