Miller actually wrote this play to parallel and satirize the "hunt" in Hollywood for Communists during the 1960's. It was all mass-hysteria and fear of the unknown...not unlike the Witch Trials in Salem.
The Puritans pointed fingers at any behavior which they could not explain as the work of witches. In the play, the entire show began as a result of the girls being in the woods with Tituba, boiling some kind of potion which was meant to grant the girls their innermost wishes. They were dancing and some were shedding their clothing. All of this was absolutely not normal Puritan behavior...especially in the woods which were considered the Devil's playground. However, the pinnacle of the girls' panic was when the minister walked up and witnessed their behavior.
Of course, the girls responded in different ways, but two of the girls, Betty and Ruth, went to sleep and didn't/couldn't wake up. This was the subconscious mind's defense mechanism against the shock they had suffered, which Rebecca Nurse correctly identifies when she suggests that they will wake when the time comes for them to wake. It's just girlish foolishness.
However, the town makes it into something more than that, and some use this as an opportunity to get back at the Reverend, to exact revenge on those in the community for whom they harbor hatred and envy, and to get possession of land they coveted.
In the end, the "witchcraft" is nothing more than the dark side of human nature...greed, envy, hatred, and vengeance.
In both the play and real life the trials were the result of a group of girls and a servant (basically slave) from the West Indies named Tituba. Tituba, in real life, was teaching the girls a "who will I marry" game, but that wasn't the end of it. Over a period of apparently some months she taught them what today we would call "voudoun," or voodoo. In the play the girls' subsequent behavior is a means of diverting attention from their deeds to alleged acts by others, complicated by the jealousy of one girl toward the wife of a married man she likes. In reality, there was probably some element of the former, coupled with hysteria caused by guilt and the Puritan's religious overreaction to the situation. We're talking about true hysteric fits, with convulsions and uncontrollable contortions of the body, not just a "hissy fit." These were truly frightening for the victim and observers. There is no historical indication of a love interest between the girl and the man.
A number of other historical discrepencies are:
play- confiscation of land by the church and civil authorities; in real life this was illegal, Gilles Corey (who was pressed) refused to confess simply because he was not guilty;
play- the clergy are blamed for the trials, as well as the civil authorities; in reality, the clergy were opposed to the trials and were the ones who eventually forced the courts to cease prosecutions; the clergy also pointed out that if the congregations understood their religion, they would not fear the "works of the Devil", which would have no power over them as believers. Unfortunately, the one most responsible for stopping the trials, Cotton Mather, later wrote a book about the "evidence" presented at the trials to try to salvage the reputations of some of the judges, and only succeeded in making them and himself look foolish to future generations.
play- all executed were completely innocent; in reality, several of those executed, including a clergyman, were people who had traded on a reputation for having occult powers. They used this reputation as pressure on their neighbors in business dealings, social influence, etc. Given the nature of Puritan society, they should not have been surprised that this backfired.
So in essence there was witchcraft at Salem, and some of the accused had a reputation of supernatural powers. This does not mean the witchcraft was "real", but it did exist. The real problem was hysteria. The play is a literary device, a fictionalised treatment of a historical event, presented as a means of criticizing a current political problem, the McCarthy-led Republican party's persecution of liberals. McCarthy's career was brought to an end when he began accusing two generals, one dead, of communist leanings and the Army intervened with Eisenhower and Marshall.
As a well-researched treatment of the events at Salem, you probably can't do better than Witchcraft at Salem, by Chadwick Hansen.