A century and a half ago, an abolitionist preacher named Theodore Parker noticed something striking about the moral universe: “The arc is a long one, my eye reaches but little ways,” he said, but added that “from what I see I am sure it bends towards justice.” Fifty years ago, the Rev. Martin Luther King Jr. confirmed Parker’s hopeful vision at the climax of his march from Selma to Montgomery, Ala. That movement led to the passage of the Voting Rights Act months later.

The abolition of slavery and the universal franchise are just two of several hard-won rights revolutions. Women’s rights, children’s rights, workers’ rights, gay rights and now even animal rights all point to the fact that we are living in what may be the most moral period in our history. Judicial torture has been outlawed in nearly every country. The death penalty is on death row and, if the trend continues, will be extinct by the mid-2020s. People have grown more tolerant: Polls have consistently shown increasing levels of acceptance of interracial marriage starting decades ago and of same-sex marriage today.

To what should we attribute this moral progress? Understandably, most people point to religion as the primary driver, given its long association with all matters moral. But the evidence shows that most of the moral development of the last several centuries has been the result of secular forces, and that the most important of these are reason and science, which emerged from the Enlightenment.

Since the scientific revolution of the 16th and 17th centuries, intellectuals sought to emulate great scientists such as Galileo and Isaac Newton in applying the rigorous methods of the natural sciences to solving social and political problems. Enlightenment natural philosophers (we would call them scientists today) such as John Locke, Thomas Jefferson and Immanuel Kant placed supreme value on reason, scientific inquiry, human natural rights, equality and freedom of thought and expression.

Locke reasoned that all people should be treated equally under the law. That was an untested theory that has withstood the test of time as countries that practice it flourish. Jefferson described American democracy as an “experiment.” It is. Democratic elections are like scientific experiments: Every few years we alter the variables with an election and observe the results. Kant introduced the “democratic peace theory” in 1795, arguing that democracies are less likely to go to war with one another. Data confirm that democratic states today have a lower risk of interstate conflict than semidemocracies and autocracies. Democracies are a moral success story.

As for slavery, the abolitionist movement was primarily inspired by such secular documents as the American Declaration of Independence and the French Declaration of the Rights of Man. As with all rights revolutions, it is ultimately the force of ideas more than the force of arms that marshal moral advancement. Notions such as slavery gradually inch from morally good to acceptable to questionable to unacceptable to immoral to illegal, and finally they shift altogether from unthinkable to utterly unthought of.

I predict that by 2020 we will look back at the current debate over same-sex marriage and ask, “What were those people thinking?” just as we now shudder at photographs of separate black and white drinking fountains.

In part, the thinking of the past was based on faulty knowledge. Today, for example, we hold that it is immoral to burn women as witches, but our European ancestors in the Middle Ages strapped women on a pyre and torched them because they believed that witches caused crop failures, weather anomalies, diseases and other maladies and misfortunes.

Science and reason have debunked such myths, and those beliefs have fallen by the wayside. The scientific worldview that holds that all effects have natural causes and that the world is governed by natural laws that can be discovered and understood, for example, led to the germ theory of disease. As more and more such problems came under the umbrella of the natural sciences, superstition and the supernatural were jettisoned as people began to change the way they thought about how the world works.

Admittedly, reason alone is not enough to secure a rights revolution.

We need legislation and laws to enforce our rights. But these forces are premised on law grounded in reason and backed by rational arguments. Without that, there is no long-term sustainability to moral progress. If your moral campaign depends exclusively on the power of the state, then when those powers change hands, those in charge can just as easily change the law. To make morals stick, you have to change people’s thinking.

The gains in tolerance from reason and science have been enhanced by travel, trade and literacy, which exposed people to new peoples and new environments. Interacting with people different from ourselves or delving into others’ minds through books makes people more empathetic and tolerant. People who know a gay or lesbian, for example, are more likely to support gay rights and same-sex marriage.

Over time, we have expanded the moral sphere of who we consider a member of our community worthy of respect, dignity and equal treatment. We’re still working at it, but it is only a matter of time before all are included.