As Ramchal had said, just as G-d “ordained (all natural) rules, He is likewise able to suspend or change them at will, at any time”. And that is the principle behind miracles, which Ramchal terms “the sorts of phenomena that G-d brings about” all fresh and new “outside of the realm of natural rules”.
Understand though that G-d prefers to maintain the natural order of things. For two essential reasons: primarily because, as Ramchal put it, “He chose it”, the natural order, among all other options and “fashioned it as He wanted” (for things could have been utterly otherwise, don’t forget), and He “knew that it was the best arrangement” since the natural order allows history to run its course for the most part.
G-d also maintains the natural order so that we could carry on with our lives comfortably and build on the past based on what we know. Otherwise we’d only do things haltingly, and always be on the lookout for what might come about or could suddenly and radically be undone. For all change, either broad and cataclysmic or subtle and refreshing, is something of a jolt and disconcerting.
(The greatest miracle of course is life itself. It comes to us as a gift out of the blue despite us, and stays with us only as long as G-d wants. For the truth of the matter is, the natural course of things is non-life, seeing as how many billions of people are no longer among the living, and how many billions and billions are yet to be born — to say nothing of the vast multitude of animals and inanimate objects that are nowhere to be found.)
The point is that nothing prevents G-d from changing things as He sees fit, from bringing on miracles.
There are various sorts of miracles, of course. Some are astoundingly novel, like the ten plagues, the parting of the Red Sea, the descent of quails in the desert (Numbers 9:18-23), and the sudden opening up of the earth to swallow the rebellious and audacious Korach (see Numbers 16:32). While these sorts of miracles are still-and-all built on natural processes, they involve radical departures from the norm, what some term, “suspensions of natural laws”. Sometimes there are what might be termed “miracle-clusters”, miracles within miracles, as when Aaron’s staff which had become a snake (see Exodus 7:10) became a staff again and then miraculously swallowed the Egyptian magicians’ staffs (see v. 12 and Rashi’s comment there).
In any case, we’re taught that G-d allows for miracles for a number of reasons. Among others, because our catching sight of them reminds us of His dominion in the course of things, and thus sets nature in its place as just another malleable quality among the very many others in the course of events. Miracles may come about because of the special needs of the moment which may be clear from the outset or only understood in retrospect (either by everyone involved or only by the righteous). Or they may come about for reasons that only G-d can fathom in order to facilitate His greater plan.
Rabbi Yaakov Feldman has translated and commented upon “The Gates of Repentance”, “The Path of the Just”, and “The Duties of the Heart” (Jason Aronson Publishers). His works are available in bookstores and in various locations on the Web.