So Moses and Aaron went to Pharaoh and did just as the LORD commanded. Aaron threw his staff down in front of Pharaoh and his officials, and it became a snake. Pharaoh then summoned wise men and sorcerers, and the Egyptian magicians also did the same things by their secret arts: Each one threw down his staff and it became a snake. But Aaron’s staff swallowed up their staffs. Yet Pharaoh’s heart became hard and he would not listen to them, just as the LORD had said. Exodus 7:10-13
There is a difference between miracle and illusion.
Pharaoh’s magicians made things appear to happen. They could make a staff look like it turned into a snake.
God made a staff literally turn into a snake.
The magicians made it appear frogs came from the ground on the second plague, but by the third, they were confused and gave up. Controlling gnats was beyond their realm of expertise.
It says they used black/dark/secret arts. That doesn’t mean Satan actually stepped in, but that they called upon spiritual forces to help them. It’s all part of act, making them look like they are in control of unexplainable powers.
God quickly humbled them and made them look like fools. The magicians had limitations to their illusion.