I'm interested in the history of how a bit of rationality finally took hold after the witch trials - how did we get from burning 'witches' at the stake to a place where society doesn't believe they exist?
The assumption must be made that belief in magic did disappear, which should not be taken for granted. The idea of science and rationality supplanting magic and religion is hardly a new one, perhaps most lyrically voiced in Frazer's The Golden Bough:
For ages the army of spirits, once so near, has been receding farther and farther from us, banished by the magic wand of science from hearth and home, from ruined cell and ivied tower, from haunted glade and lonely mere, from the riven murky cloud that belches forth lightning, and from those fairer clouds that pillow the silvery moon or fret with flakes of burning red the golden eve. ^^1
While James Frazer was as influential as he was controversial, the reality was that folk belief can not meaningfully be said to fall into such a rubric, and much like the oral tradition that sustains it, is very durable.
Perhaps a better question might be what factors led to the decline of witch-persecutions, and did changing vernacular beliefs play a role?
^^1 ^(James George Frazer. The Golden Bough: A Study in Magic and Religion. London, England: Macmillan, 1925. p. 1279)
Let me suggest an alternate frame for the question, partially based on a thing I'm reading right now.
The title is Religion and the Decline of Magic by Keith Thomas - there's a review here. It's a fat book, demonstrating how "magical thinking" subtly changed into more familiar forms of religious faith through the 16th and 17th centuries.
I'm sure that's an oversimplification, but I'm just getting into it right now.
(Bear in mind, most of his study is looking at England during the time preceding the Salem Witch Trials in the colonies. But still - those trials might illustrate that the persecution of "witches" wasn't really as much based on Enlightenment rationality as on a different kind of magical thinking.)
Another angle of the reframing I'm suggesting comes out of Alexander Cummins' The Starry Rubric: Seventeenth-century English Astrology and Magic - review here - which traces the relationship between astrology, herbalism and modern medicine in the 1600s.
In quite a few cases there, the old belief system wasn't so much supplanted by a new one as it slowly transformed via the scientific method. Planetary influences gradually shaped into early psychological theories, alchemical processes revealed themselves as chemical reactions, maybe even beliefs about "bad air" gave way to germ theory... in other words, what you might be thinking of as "magic" in some ways really was "science," or something more scientific than it is often portrayed today.
You might also be interested in episode 8.20 of Dr. Philip Harland's Religions of the Ancient Mediterranean podcast. That's a lecture he gave on witchcraft accusations - specifically in the context of the medieval conception of Satan.
A lot of the decline in supernatural beliefs occurred during the Enlightenment which started around the time the witch hunter Matthew Hopkins died. Skepticism grew around ideas of witchcraft, and to a lesser extent religion in general, which provoked defenses of supernatural beliefs. There were writers like Thomas Ady who published books against most notions of witchcraft. Joseph Glanvill and Cotton Mather are examples of writers who tried to prove witchcraft existed as a defense of religion. One of the major themes of the Enlightenment was skepticism growing and counter religious movements. Atheism was also a perceived threat to religion as philosophers wrote about during the Enlightenment too. Some authors from the period that define this debate are David Hume, Pierre Boyle, Increase and Cotton Mather, Thomas Ady, Matthew Hopkins, and Henry More. Thomas Hobbes also included a chapter on the supernatural in Leviathan. I recently posted about this on my WordPress blog. The full post is here if you want more info-https://salemwitchtrialsresearch.wordpress.com/2015/12/23/witchcraft-in-the-print-culture-of-early-enlightenment-england/