Part of the decline in accusations of witchcraft was the rise of the Enlightenment. As others have pointed out, witchcraft (or the punishment thereof) flourished in an age of ignorance. Religion, upholding the social order, found a means of repressing undesirable people, women and men. However, as science made its inevitable investigations of cause and effect during the Enlightenment and the rigid authority of the Church was questioned, that which did not fit into the scientific model was discarded -- hence the dispensation of Spectral Evidence in New England, for example. Furthermore, political philosophies changed. The Rule of Law became established during this time; an authority could not go around murdering undesirables on a charge of witchcraft on a whim.
There was a common belief at the time that good and evil were both constantly at work in the world; the devil was often up to mischief attempting to harm human kind. Those accused of witchcraft were believed to have engaged in carnal intercourse with the devil, and thus performed his bidding. If cattle or sheep became sick, a witch was born. Old women who carried food to a child who later became ill were believed to have cast a spell to harm the child. Even male impotence was blamed on the work of witches performing the devil's bidding. It was typical of the superstition of the time which was prevalent.
Back in the times where scientific explanations were neither advanced nor widely accepted, people used spirituality and religion to explain the natural world, and attributed those things that were evil to the Devil. This neatly explained everything that happened, everything good was a blessing, everythigng bad a curse. In this environment, it's not surprising that witch hunts were common and repeated.
The reason for the decline of accusations regarding witchcraft were rooted in the fact that government officials and family members of government officials were being accused. Outside of that, once spectral evidence was removed from being allowed in the courts, evidence against the accused became very circumstantial.
One explanation has been that suspicions and accusations of withcraft were used to control women who otherwise seemed out of control for whatever reasons. The 16th and 17th centuries were strongly patriarchal; most power was held and wielded by men. The idea of women with supernatural powers may have threatened many people partly because these seemingly powerful people were women. That, at least, is one explanation of the phenomenon.
After the Reformation, the continent experienced a great deal of fighting as a result of religious and political factors. There was a civil war in France, a war for independence in the Netherlands, and of course the Thirty Years' War in the Holy Roman Empire. There were also bad harvests and other economic disasters, many of which resulted from the conflicts. This is the context for the witch hunts, though many scholars have emphasized more local causes for individual witch hunt episodes, which tended to come in fits and starts.
Scholars tend to cite religious uncertainties and general social turmoil. They say that things were in a state of upheaval what with the Reformation and economic changes. People were uncomfortable with the changes and that made them likely to look for scapegoats for problems. Since there were so many problems, they tended to look for some way to explain them and they hit on witchcraft.