So what are some of the Jewish theories as to what the origin of demons actually is?
There are a ton and a half of different stories.
Some say that demons are what you might call "rough drafts" of humans or angels or some other creature entirely that God left "unfinished" because they were inherently flawed.
Some say that demons are manifestations of the negative side of divine energy, the Sitra Achra. Sort of "anti-angels," if you were. Kind of a metaphysical matter/antimatter thing.
Lurianic Kabbalah, which is quite its own thing, and more than a little weird, postulates that all negative aspects of creation are attributable to a primordial cataclysm of a radical imbalance of the divine energy, and demons therefore are fragments of the cataclysm that have turned negative in their shattering away from the heart of Divine order.
Some have said that demons were the spawn of Adam Kadmon (the primal Platonic ideal of Adam) and his first wife, Lilit.
Some have said that there were a kind of negative angel that God sent down to earth in antediluvian times that took physical forms, gained mortal appetites, and sired children on human women, some of whom became mostly human mythic figures of might, and some of whom became mostly non-human demons.
Some have said that demons are souls of people lost between the worlds, who have become crazed and full of rage, and come back to this world strong and malicious.
Some have said that demons are merely a kind of spiritual creature, below the angels, but unlike humans, that inhabit the wild places and so forth, who have a tendency to be misanthropic, reclusive, and violent.
There are many variations on these views, and some other views also, but I can't recall more off the top of my head.
I'm not sure if I'm remembering this right, but, wasn't the demon king, Ashmodai said to have been a Jewish demon (like he studied the Torah, observed the Holy Days, etc). Would that have made him someone who was considered a good demon, or was he still considered dangerous?
Yeah, if you can get your hands on a Schottenstein Talmud, you can read this great story, one of the world's longest tangents, in Tractate Gittin 68ab, all about Ashmodai King of Demons, and one of the things you find is that every day, he spends the morning in Heaven, learning Torah at the Heavenly Yeshivah.
You gotta keep in mind that the Rabbis of the Talmud created an ideal of the world in their own image, and in their literature, imposed it on reality. So when one reads Talmud critically, one can spot a number of flaws in the reasoning, as well as having to sort out, from time to time, what actually was the truth about the world at the time of the Rabbis, and what do they want to believe was the truth. The same thing kind of goes for their midrash, as well. So in their world, everyone studies Torah. Even the King of Demons studies Torah. The fact that it seems odd that he might do so and yet still be, if not really evil, certainly quite unpleasant, doesn't seem to have struck the Rabbis as needing resolution. For which there really is none. One either lets it go, or not, I'm afraid.
Or, as one of my professors at rabbinical school said, "Sure, he studied Torah every day. But there's nothing that says he learned anything from it."
I definitely love Trachtenberg's book, I haven't finished it yet, but, I do really like it. I do have another question, though, since demons were brought up, is Lilith one of the few Jewish demons who come close to being evil (I heard one person say, Lilith is the closest thing Judaism has to the Christian Satan), but, I've also read that, in Jewish Mysticism, Lilith is said to be the Bride of God, while The Shekinah is in exile.
Demons have gone through a lot of different conceptualizations through Jewish history, and depending upon where in the Jewish world they were being written about. But it was in the Babylonian communities, and then in the communities in Israel with whom the Babylonians interacted that there first appear talismans and amulets concerning demons and malign spirits that bring ill-health, dangers, and other misfortunes on people. That was a step in a darker direction, and during the Middle Ages and early Renaissance, demons were thought of us much more worrisome, much more evil, in the sense of having all kinds of malicious schemes against people, thirsting for blood sometimes, or such things.
It seems like, for whatever reasons, demons became rather less feared and focused-on during the Enlightenment (not that the majority of Jews in Europe were becoming Enlightened), and in the Mizrahi communities, while demons were still widely spoken of until a generation or two ago (and occasionally are still spoken of), they seem much less sweepingly evil, and more akin to the petty thugs they were once thought of as being.
Lilit started off as a midrash about rebelling against God's will, and perhaps about what the Rabbis of the Talmud perceived as the perennial imperfection of woman's nature (those guys were
not feminists, unfortunately). She took on a persona in culture not long after as the spirit of jealousy, being kind of a succubus, going after men's spilled seed (a midrashic object lesson about masturbation, possibly), and using it to have demon babies, and, initially, doing wicked things to women, because she envied them their married happiness.
Over the course of the following millennium, she kind of passed into an uber-demoness character, mother of a host of demons, willing and eager to do all sorts of horrible things to people because of her mad jealousy at their goodness and happiness. I think in that particular strain of the mythos, she probably is, in some ways, the closest analogue to Satan we have, and for good reason: I would guess, as I believe some others have also, that stories of Lilit were increasingly influenced by Christian demonology over time. Our demonology and attandant magic and rituals were "low Kabbalah," being very much folk beliefs, and having little support either from mainstream rabbis or from greater Kabbalists.
Which is in part, I think why the authors of the Zohar sort of tried to re-appropriate her and elevate her up a notch into a sort of anti-Shechinah of the Sitra Achra, or of a negative influence on the Atik Yomin (higher aspects of the emanations), blocking or diffusing the flow of shefa (divine energy) through the Ze'er Anpin (the lower aspects of the emanatons).
Frankly, I never cared for the Lilit mythos. It started off reeking too much of misogyny, and ended up smacking too much of Christian syncretism. I don't hold that there is a Lilit, personally.