Does God break the laws of nature in miracles such as the staff of Moses (as)?
No. God does not break His own laws. In a miracle, a power of God is at work that follows laws hidden from people and stronger than the ones we know.
The Holy Qur’an makes a very careful distinction between what Pharaoh's magicians did and what happened with the staff of Moses (as). Of the magicians it says that they deceived people's eyes. Nothing actually happened to their ropes. They remained ropes. The magicians had no power over the laws God has placed in nature.
How this deception came about cannot be said with certainty. Some think of clever tricks. Another explanation lies in the power of the mind. A strong will can influence others so that they see something that is not there. The magicians knew full well that they were only deceiving. That is why they fell down at once when they saw that something entirely different was happening with the staff. It went beyond any human art.
For the staff, the Holy Qur’an never uses the word magic. Exactly how it happened, we do not know. God can do anything. And yet the Holy Qur’an and the life of the Holy Prophet Muhammad (saw) show that it is not God's way to break His own laws. A lawgiver who constantly had to overturn his own laws would be a poor picture of God. The verse above says that God's way does not change.
There are, however, visible laws and hidden ones. Sometimes a familiar law seems to be suspended because a deeper and stronger one is at work that people do not know. This miracle can be understood in that way too. God's power over the mind is incomparably greater than any human's. It could cause Moses (as) and everyone present to see the staff as a serpent, and the magicians' ropes to vanish from their sight. That, too, would be a law God has made.
What matters is what the Holy Qur’an states clearly. It was not the mind of Moses (as) or of any other human being that brought this about. It was God. A miracle is therefore not a break in the order of things, but a sign of how much deeper God's order reaches than we can see.