Magic in fiction is generally postulated to break the laws of physics. That’s fine. You could imagine the laws would be different. There might be some issues with even that that a physicist could point to, but I see no obvious problem with postulating such changes. However, with many forms of magic, there’s another problem that can’t be solved even by changing the laws of nature.
The problem doesn’t arise if your magic does something crude like a fireball or, I don’t know, causing an earthquake. These can be seen as relatively simple processes where you just use the magic power to create some heat or move things or the like. But some magic is the opposite, particularly creating something like a living being — or just an artifact, for that matter — out of nowhere, or changing the form of something radically.
Let’s just imagine you create a mouse by magic. How does that work? I’ll grant that magic is allowed to create matter out of nowhere. I’ll grant that it’s allowed to manipulate matter in any way whatsoever you like.
Then how do you get a mouse?
A mouse is not made up of any special kind of matter, or at least not any special kind of atoms, but it’s an extremely complicated system. If I had the ability to create matter and manipulate it as I wished, I certainly couldn’t create a mouse based on just that. If I had a list of all the exact chemicals included in a mouse, I’d be little closer. (And I don’t think fantasy wizards have knowledge like that anyway.) I’ll make an educated guess that the totality of humanity doesn’t possess enough information about how exactly mice are built to be able to build one from scratch if they were given free control over matter. You’d need to arrange all the right chemicals into all the right cells and those into all the right organs… If a wizard just points a wand and imagines a mouse in his mind, he doesn’t have an image of all this in mind. Is it the spell that gives all that information? Well, okay, maybe the spell is kind of like a computer program that does things automatically, but who wrote it? Even if a fantasy world doesn’t have matter with the same kind of complicated microstructure as in our world, presumably normal beings in it still have organs and stuff.
This point can be generalised, of course. If you do something with magic that involves the creation of a complex structure, where does the specified complexity come from? It’s true complexity develops in the real world from simpler systems, but that involves complicated interactions and lots of time, not just the waving of a wand. You could also put it this way: while our simple mental model of what a mouse or something else is like may be enough for us, it’s nowhere near detailed enough to build a mouse from scratch.
It’s not impossible to come up with explanations for how it works. Perhaps there are some kind of objectively existing essences in the fantasy world that can be invoked to create such things and will guide the process. But usually it’s not addressed. It’s one of the reasons I have been unsure what kind of magic I should use in my own fantasy writing.