With several centuries having passed since the Salem Witch Trials took place, it seems obvious to say that there was no actual witchcraft taking place. The urine cakes, eggs in water, and divination were probably more of a head game than real witchcraft taking place (but who really knows..)
Historians, sociologists, and authors have all reflected on what the reasoning behind the obscure trials was. How did this happen? And how did it so quickly get out of control? Having a single answer would be the most simple and rewarding answer. One and done. It must have been young girls looking for attention in their community. Or there was some awful disease going around that was affecting the towns judgement. But in reality, there is no way that there is one single answer for the Salem Witch Trials. It was just a perfect storm of events and social settings that caused this eruption.
While there are many theories that try and explain what happened, there are a few that seem more likely than the rest. The first, and one of the most likely I'd say, are the economic, political, and social factor at play. With the community of Salem having been political divided by years between powerful families, that is a huge factor at play here. Without the Putnams and Porters in Salem, it is easy to entertain the thought that these witch trials may have never taken place. Or at least not to the extent they did. In the book Salem Possessed, the two authors Boyer & Nissembaum explain how the rapid growth of the town and its' population unintentionally caused social, political, and economic unrest. Without a charter in place, the trials progressed faster than they normally would have. This explanation definitely plays a part in the events but I wouldn't say it accounts for the entirety of the Witch Trials.
John Demos, author of Entertaining Salem, took a completely different approach to explaining Salem. In his eyes, this was a sociologic and psychologic issue with the women of Salem. Young girls felt completely oppressed by the tight Puritan community and had no room to be themselves or anything out of the ordinary. On top of that, all of the accused and accusors knew each other, and that could have played a role as well. Carol Karlsen wrote a book only 5 years after Entertaining Salem was released - The Devil in the Shape of a Woman. She, along with Demos, agrees that it has to do with the women of Salem, but to her, it is entirely about gender. With women, particularly young girls being the lowest on the totem pole of Salem society, these outbursts were one of the only things they could do for attention and to be noticed. If women were not married, they had pretty much no social standing at all, and were usually inside of the home and constantly supervised. That alone is enough to make anyone go crazy for some kind of attention, if you ask me. Contrastingly, it make sense that older, wealthy women were accused because then they would no longer inherit money or land from their family or spouse.
The role of gender I would say is easily one of the biggest contributing factors to these events. Like I said, it was a definite mix of things, but if the Salem Witch Trials were a recipe, I'd say gender roles are one of the main ingredients.
An obvious factor is of course, religion. With Salem having a total lack of a legal system in place, there was somewhat of a crisis to figure out what the hell was going wrong with so many people. It was everything - divination, astrology, folk magic, all against Puritanism. Which, in case you forgot, it as pretty much as intense of a religion as you can get. Living in a god-fearing society that believes everything is a punishment or reward from God is inevitable going to cause some rash decision making when people start saying they're possessed by witches.
Historians and sociologists alike have tried coming up with every kind of explanation for these trials. Some have linked these to the Indian Wars, and the Puritan fear of the Native Americans. Others have tried blaming it on Ergot poisoning and other diseases, none of which check out. While most people, historians in particular, would like one simple, cookie-cutter answer for how the Salem Witch Trials even happened, it is just not possible. These events are an example of the perfect storm of events that eventually led to a complete explosion of society.