Think, for example, about the Nazis. Nazi racial theory was a bogus pseudoscience. Though they tried to buttress it with scientific evidence, the Nazis nevertheless had to silence their rational faculties in order to develop a belief strong enough to justify murdering millions of people. Yet when it came time to design gas chambers and prepare timetables for the Auschwitz trains, Nazi rationality emerged from its hiding place intact.

What’s true of the Nazis is true of many other fanatical groups in history. It is sobering to realize that the Scientific Revolution began in the most fanatical culture in the world. Europe in the days of Columbus, Copernicus and Newton had one of the highest concentrations of religious extremists in history, and the lowest level of tolerance.

Newton himself apparently spent more time looking for secret messages in the Bible than deciphering the laws of physics. The luminaries of the Scientific Revolution lived in a society that expelled Jews and Muslims, burned heretics wholesale, saw a witch in every cat-loving elderly lady and started a new religious war every full moon.

If you had traveled to Cairo or Istanbul around 400 years ago, you would have found a multicultural and tolerant metropolis where Sunnis, Shiites, Orthodox Christians, Catholics, Armenians, Copts, Jews and even the occasional Hindu lived side by side in relative harmony. Though they had their share of disagreements and riots — and though the Ottoman Empire routinely discriminated against people on religious grounds — it was a liberal paradise compared with Western Europe. If you had then sailed on to contemporary Paris or London, you would have found cities awash with religious bigotry, in which only those belonging to the dominant sect could live. In London they killed Catholics; in Paris they killed Protestants; the Jews had long been driven out; and nobody even entertained the thought of letting any Muslims in. And yet the Scientific Revolution began in London and Paris rather than in Cairo or Istanbul.

The ability to compartmentalize rationality probably has a lot to do with the structure of our brain. Different parts of the brain are responsible for different modes of thinking. Humans can subconsciously deactivate and reactivate those parts of the brain that are crucial for skeptical thinking. Thus Adolf Eichmann could have shut down his prefrontal cortex while listening to Hitler give an impassioned speech, and then reboot it while poring over the Auschwitz train schedule.

Even if we need to pay some price for deactivating our rational faculties, the advantages of increased social cohesion are often so big that fictional stories routinely triumph over the truth in human history. Scholars have known this for thousands of years, which is why scholars often had to decide whether they served the truth or social harmony. Should they aim to unite people by making sure everyone believes in the same fiction, or should they let people know the truth even at the price of disunity? Socrates chose the truth and was executed. The most powerful scholarly establishments in history — whether of Christian priests, Confucian mandarins or Communist ideologues — placed unity above truth. That’s why they were so powerful.

Yuval Noah Harari (@harari_yuval) is an Israeli historian and the author of “Sapiens: A Brief History of Humankind.”

Now in print: “Modern Ethics in 77 Arguments,” and “The Stone Reader: Modern Philosophy in 133 Arguments,” with essays from the series, edited by Peter Catapano and Simon Critchley, published by Liveright Books.

The Times is committed to publishing a diversity of letters to the editor. We’d like to hear what you think about this or any of our articles. Here are some tips. And here’s our email: letters@nytimes.com.

Follow The New York Times Opinion section on Facebook, Twitter (@NYTopinion) and Instagram.