If you read through Chapter 11 of the Rambam's laws on Idol Worship, you'll see what seems to be the Rambam forbidding anything that even resembles magic, all while calling such practices foolish and saying they have no effect at all, neither good nor bad.
But then you get to Halacha 15, where the Rambam says:
"A sorcerer must be condemned to execution by stoning."
And just in case you thought the Rambam meant that this "sorcerer" was pretending to perform sorcery (since it seems he holds that it doesn't exist), the very next words are:
"This applies when he commits a deed of sorcery. If, however, he merely deludes those who observe him into thinking that he is performing an act although he actually does not, he is given stripes for rebelliousness."
Then in the next Halacha, the Rambam returns to his previous theme:
"All the above matters are falsehood and lies with which the original idolaters deceived the gentile nations in order to lead them after them. It is not fitting for the Jews who are wise sages to be drawn into such emptiness, nor to consider that they have any value as [implied by Numbers 23:23]: "No black magic can be found among Jacob, or occult arts within Israel." Similarly, [Deuteronomy 18:14] states: "These nations which you are driving out listen to astrologers and diviners. This is not [what God... has granted] you."
Whoever believes in [occult arts] of this nature and, in his heart, thinks that they are true and words of wisdom, but are forbidden by the Torah, is foolish and feebleminded."
What's going on? Does the Rambam believe in the efficacy of black magic and sorcery or not? What's the explanation for this seeming contradiction?
(Thanks to @Curiouser and @ShmuelBrill for this question.)
Related: Why is there no magic today?