Many expressed surprise recently when, in one of its periodic surveys of Americans' views of other faiths, the Pew Research Center found that atheists fare poorly—fully 40 percent of those polled described their views toward atheists as "cold." Jews, Catholics, Evangelicals, Buddhists, Hindus, Mormons—all are viewed more favorably than nonbelievers. Only around 2 percent of Americans identify themselves as atheists, even though religious observance, measured by things like church attendance and daily prayer, has been trending downward for decades.

You might think that America would be fertile ground for the rise of atheism. After all, the United States is the most scientifically advanced society in human existence, and as far as atheism has a history—and it is an oddly uncharted one—it is popularly believed to be of slow, steady scientific advance.

Once upon a time, so the story goes, people believed that the world was young and flat, that God made everything including people in a few, frantically busy days, and that earthquakes and thunderstorms were examples of his furious rage, which you ignored at your peril. Into this sorry state of affairs, emerged a thing called "science" and, despite the best efforts of ignorant, self-serving clerics who wished to keep the people in utmost darkness, "science" proved that none of the above was true. Gradually, wonderfully, the human race matured, with every confident scientific step forward pushing our infantile, crumbling ideas of the divine closer to oblivion. "Extinguished theologians lie about the cradle of every science, as the strangled snakes besides that of Hercules," as Thomas Huxley, the English biologist known as "Darwin's bulldog," memorably put it.

The problem with this particular creation myth is that whilst it is true enough to be believable, it is not true enough to be true. "Science"—if we can treat that collection of disparate disciplines as one single, coherent enterprise—did have something to do with the growth of atheism in the West, but very much less than most imagine. Those three great moments of scientific progress—the Copernican revolution in the 16th century, the scientific revolution in the 17th and the Darwinian in the 19th—were hardly atheistic at all. Copernicus was a priest; Francis Bacon, the father of modern science, devout; and Charles Darwin incredulous that anyone could imagine evolution demanded godlessness. "It seems to me absurd to doubt that a man may be an ardent Theist & an evolutionist," he wrote in 1879.

In reality, the growth of atheism in Europe and America has much more to do with politics and, in particular, ecclesiastically backed politics, than it has with science, something that is clear even from its earliest days. The first person we can unequivocally call an atheist in modern Europe was a French Catholic priest who died in 1729. Jean Meslier led an unremarkable life at Étrépigny, in Champagne. On his death, however, friends discovered a manuscript, his "Testament," which denounced all belief, all God and all religion with a frenzied anger that makes Richard Dawkins' The God Delusion seem like a work of reasoned scholarship.

But then, Meslier did have a great deal to be angry about. Early 18th-century France was politically and intellectually asphyxiated. Philosophy was stuck in pre-Cartesian days and, in any case, subordinated to theology. The monarch ruled with absolute power that was justified by a fabulously wealthy and notoriously intolerant church. People were still being publically tortured and executed for 'religious' crimes as late as the 1760s. This was the environment that bred Meslier and his better known atheist successors, philosophes like Denis Diderot, Baron d'Holbach, Julien La Mettrie and Claude Adrien Helvétius. Europe's first public atheists were driven from mere scepticism and anti-clericalism to full-blown unbelief not by reason or scientific progress but primarily by a venal and violent theo-political settlement.

Britain offers a good, contemporary counterexample. No less scientifically or philosophically sophisticated than their Gallic neighbours, the British were notably more intellectually and politically tolerant. Robert Boyle and Isaac Newton typified the first kind of toleration, adamant that science was not only compatible with Christianity, but actively supported it. "This most beautiful system of the sun, planets, and comets, could only proceed from the counsel and dominion of an intelligent Being," Newton wrote in Book III of his Principia. If the greatest scientist in Europe thought this, who was anyone to say different? John Locke typified the second kind of toleration, doing the intellectual heavy lifting for the newly tolerant and (relatively) accountable political settlement in his Treatise on Government and his Letter Concerning Toleration, both of which were deeply and explicitly biblical.

The result of all this was that British sceptics in the 18th century—and there were many—were not driven to atheism. Not only was there space to think new thoughts and embrace new ideas within the established churches, but there was a lot less to object to in their political activity. When David Hume, the greatest sceptic of his age, was charged with heresy he was defended by friends, including many clergymen. "These illustrious examples [of moderate clergy]," he subsequently wrote, "must make the infidel abashed of his vain cavails, and put a stop to that torrent of vice, profanities, and immorality, by which the age is so unhappily corrupted."