According to the Midrash, Shmot Raba 10:7, the dust in Egypt was transformed into lice to punish the Egyptians who forced B’nai Yisrael to sweep up the dust in the streets and marketplaces. During the plague of lice, when the Egyptians needed dust, they went to dig but all that they were able to come up with was lice.
In Shmot 8:12-14, we read about the plague of lice:
God said to Moshe, “Say to Aharon, Extend your rod and strike the dust of the earth; and it will turn into lice throughout the whole land of Egypt.” They did so. Aharon extended his hand with his rod and struck the dust of the earth, and there were lice on man and beast. All the dust of the earth turned into lice throughout the whole land of Egypt. The sorcerers did likewise with their magic art. They tried to bring forth lice but they could not, and there were lice on man and beast.
The Midrash continues: “The sorcerers were not able to bring about lice with their magic art”. Rabbi Elazar said: “We learn from here that the sorcerers were not able to use their demons to create something that is smaller than a barleycorn.” The rabbis taught: “They wouldn’t even be able to create a giant animal like a camel since a demon can’t create anything, they can only gather animals from far places. Big animals can be brought over but small creatures such as lice could not be brought over.”
In the first two plagues, blood and frogs, the sorcerers thought that Aharon was using demons. However, when the sorcerers couldn’t bring about lice from the dust the way that Aharon did, they acknowledged that Moshe and Aharon’s work was the “finger” of God and we no longer see them trying to copy any of the other plagues.
In Shmot 8:2-3 we read about the plague of frogs:
Aharon extended his hand over the waters of Egypt, and the frog emerged and covered the land of Egypt. The sorcerers did likewise with their magic art, and made the frogs emerge upon the land of Egypt.
In Shmot Raba 10:4 we see an argument over how the frogs were brought about:
It was taught: Rabbi Akiva said: “There was one frog and it produced a swarm of frogs and it filled the land of Egypt with frogs.” Rabbi Elazar ben Azaryah said to Rabbi Akiva: “Akiva, what do you have to do with Aggadah (legend)? Cease your discourses and focus on Halacha, the laws of Negaim and Oholot! Rather, what happened was that there was originally one frog and it croaked and the others came.”
It wasn’t a big deal for the sorcerers to bring frogs because one frog croaked which brought the others over. However, the lice were too small to bring their friends and actually had to be created directly from the dust, a miraculous task that only God could perform.