Exodus 8:24
And the LORD did so; and there came a grievous swarm of flies into the house of Pharaoh, and into his servants’ houses, and into all the land of Egypt: the land was corrupted by reason of the swarm of flies. And the LORD did so; and there came a grievous swarm of flies into the house of Pharaoh, and into his servants’ houses, and into all the land of Egypt: the land was corrupted by reason of the swarm of flies.
The swarms were not common houseflies that merely annoy, but large and venomous flies whose sting or bite brought very painful suffering to both people and animals. They were sent as a judgment and a further trial because appeal and warning to let the people go had failed. God did as He had said, fulfilling the threatened judgment on the next day.
A grievous swarm came into the house of Pharaoh and into his servants' houses and into all the land of Egypt. The flies filled the houses and swarmed over the ground, so that the land was corrupted and ruined. Its time had been told beforehand so that it could not be called chance.
God separated His people from the Egyptians and severed off the land of Goshen where Israel dwelt, as foretold and previously stated, so that no swarms or flies appeared throughout their coasts. This division between God's people and Pharaoh's people was made to prove that the LORD is in the midst of the earth. As the fourth plague, it exposed the powerlessness of Egypt's fly-god Beelzebub, worshiped as the people's protector from such swarms, showing by bringing the feared infestation that the idol could not protect the Egyptians and that they must look to Jehovah for relief.
The corruption of the land pressed Pharaoh to call Moses and Aaron and offer that Israel sacrifice to God inside the land. Moses refused and insisted on going three days' journey into the wilderness to sacrifice as God commanded, because Israel would sacrifice before the Egyptians' eyes what was an abomination to them. The Egyptians worshiped certain beasts as sacred and counted slaying one, even accidentally, an unpardonable offense punishable by death, and they would stone Israel for it. When Pharaoh while under chastening consented and asked Moses to entreat for him, Moses interceded and God removed every fly, yet Pharaoh hardened his heart and would not let the people go.