There is a distinction you will sometimes hear made by writers and readers of fantasy fiction between hard magic and soft magic.
Soft magic is magic that just does what the author wants it to do in every case, with no (or little) explained rules or logic. Think of Gandalf in The Lord of the Rings. What exactly can Gandalf do, wizard that he is? We don't really know. He makes lights, he seems to be able to see and communicate at a distance, sometimes, but there isn't much precision around it.
Hard magic is more like the magic in a roleplaying game. It's crunchy, it works according to specific rules, that both good and evil wizards have to live by all the time. Think about Kvothe in Patrick Rothfuss's Kingkiller Chronicle, or Jim Butcher's wizard P.I. Harry Dresden in The Dresden Files. For them, magic works by rules that wizard and reader both know in advance, and that don't vary. We know that Kvothe needs an energy source and a conduit to cast his spells; we know that Harry needs two ingredients for any potion; etc.
This is a spectrum, of course. Harry Potter, for instance, lies somewhere in between. Every year he learns two or three new spells, which have no real logic to how they work or their limitations, but once they exist, Rowling makes them pretty consistent in terms of their mechanics. Expelliarmus!
Which kind of magic system is best?
I think that's the wrong question. The right question is: what kind of magic system is best for the story I am telling? Your choice of magic system should serve your story, just like all the other authorial choices you make.
Here are some questions to ask yourself:
1. Do the specifics of the magic system matter at the climax, or for the resolution of any of the major conflicts in the story?
2. Is your protagonist a magician? (You don't want your good guys to have undefined and potentially imbalancing powers; it might work just fine for your bad guys to have those powers, though.)
3. Is your story milieu-driven, and is the detail of an interesting magic system an important part of your milieu?
A yes answer to any of the above should probably incline you to include more hard elements in the design of your magic system. The first question is really the key one. Magic is not a way to cheat. If you introduce magic so that your heroes can pull an unexpected rabbit out of their hat at the end of the story, you're doing it wrong.