Well, a few things, just to go over what Kabbalah and the Zohar are, and where they come from. You probably know all this, but there may be some people who don’t. First of all, religion is the way that a community tries to understand the world around it, and through group ritual and practices, to solidify their group identity and communicate with the divine. However, religion in that way can be unsatisfying to people, and often times people seek to bypass that and try to find ways to communicate directly with the divine without ritual “getting in the way”. This sort of practice is generally called mysticism. What mystic groups tend to believe is that beyond the ritual of religion, there’s some sort of special truth that’s hidden from the great mass of believers, but that it’s possible through prayer and study to become enlightened, to uncover the hidden meanings behind the public ritual and holy books, and to enter into a personal communication with the divine. This is mysticism, this is occultism, and it’s something you find throughout religion. In Christianity, it’s things like the monastic movement and Pentecostalism, in Islam, it’s the Sufi brotherhoods, and in Judaism, it’s Kabbalah.
One of the things monotheistic religion has to come to terms with is the problem of evil. If you have a good, all powerful god, then how come bad things happen? This question was especially pressing to late thirteenth century Spanish Jews.
Muslim Spain under the Umayyids had been a really welcoming place for Jews. The Umayyids had been generally religiously tolerant. Jews and Christians were generally allowed to practice their faith freely without much religious discrimination, and the Jewish communities of Spain were allowed to govern themselves. Under that rule, the Jewish population ballooned, and Jews came to occupy important places as advisors, generals, and poets.
Then the Umayyid government collapsed, and Muslim Spain split up into a bunch of small Muslim kingdoms, each of which struggled constantly with each other. Eventually, the Almoravids came in from North Africa and conquered the taifa kingdoms. They were succeeded by another group of North African conquerors, the Almohads, in 1170.
The Almohads were Muslim fundamentalists, and they were notoriously intolerant, harshly persecuting the Jews and Christians under their rule. The Jewish communities of Muslim Spain, which had been thriving just over 100 years before, were now barely holding on, with Jews facing harsh discrimination and the fear of pogrom and massacre.
Under these circumstances, the Jews of Muslim Spain asked “Why? Why had God allowed the Almohads to take over the state and persecute His chosen people? Why didn’t He strike the Almohads down, and set His people free?”
A rabbi named Moses de Leon of Avilla thought he knew the answer. He wrote a book called the Zohar (although he claimed that he was just writing down the teachings of a second century rabbi, Shimon bar Yochai, who had gotten the teachings from the prophet Elijah, who had appeared to bar Yochai and taught him them when bar Yochai was hiding from the Romans. The Zohar tried to explain why there seemed to be evil in the world, and how people could overcome the evil of the material world and use their understanding of the divine to bring about a perfect universe.
As for demons and magic, demons and magic were accepted as real all over the ancient and medieval world, and that was true of Jews as much as it was of Gentiles.