https://www.haaretz.com/archaeology/2017-08-17/ty-article/th...
There was even an old belief (that I think came from the Babylonian Talmud but I'm not sure) that King Solomon used a magic ring that bound demons to build the first temple. This genre of "Solomonic" magic is where the Ars Goetia and its famous roster of demons comes from[0], which pop up from time to time in pop culture.
What's particularly interesting is that, given that literacy of the time was primarily among the nobility and how much liturgical information there is in a lot of texts on ceremonial magic, there must have been an underground of occultists within the priest class of the Church at the time reading and writing all of this.
[0]https://en.wikipedia.org/wiki/List_of_demons_in_the_Ars_Goet...
In the US and Europe at least, witch-hunts and the paranoiac ferver around them arose in the context of apocalyptic Christian belief at the time - Christians believed they were living in the "end of days" and that Satanic forces were being arrayed everywhere to infiltrate their communities and corrupt and undermine their values. "witches" weren't simply pagans, but people who actively and willingly entered into contracts with the Christian devil. Modern day witchcraft and neopaganism bears no resemblance to what people of the time recognized witches to be, it didn't even really exist at the time.
In a finer-grained context, this could have been an expression of anxiety over cultural and political change, and very often it manifested as anti-Semitism (it's no coincidence witches were depicted in caricatures similar to Jews and that their meetings were called sabbats.) racism and misogyny, and like many moral panics today, was often employed by the religious and political powers to their own ends.
One can see it today within the right-wing fringes of Christianity and QAnon, and their conspiracy theories about Satanic rites among the "elites" and "leftists" (which has many elements of anti-witch and anti-Semitic beliefs of yore,) within a movement almost entirely defined by fear of the future and the corrupting influence of secularism and "traditional values."