Jimmy Carter teaches a Sunday School class on August 23, 2015David Goldman / AP

For the last two weeks, pilgrims have been flocking to Maranatha Baptist Church in Plains, Georgia. They’re coming from Ohio, from Maine, and from California to attend church in a small town two hours south of Atlanta. And they’re doing it to see 90-year-old Jimmy Carter teach an all-ages Sunday School class.

The week after Carter announced he had brain cancer, 1,000 people showed up. The next week, as David Weigel reported in the Washington Post, the church put a system in place: Arrive by 12:01 a.m. on Sunday and you’d be admitted to the church parking lot, where you could sleep in your car until morning.

Sunday School is rarely thought of as the coolest place to be. But it remains extraordinarily popular, even when it’s not taught by a beloved former president. With millions of weekly attendees, in fact, is one of the most significant sources of adult education in America. That’s a loose definition of “adult education,” of course: Adult Sunday School can be anything from near-academic exegetical lessons to free-form prayer groups. A 2005 survey by the evangelical pollster George Barna found that 18 percent of adults who consider themselves Christians (about 80 percent of the country, by Barna’s measure at the time) attended Sunday School in a typical week. Among Protestants, the figure was 25 percent. That same year, Barna found that more than nine out of 10 churches offered classes for young children and adults.

The Post story notes that not all of Carter’s acolytes are fellow Democrats. But the origins of Sunday School tell a story about the kind of progressive evangelicalism that Carter is known for. The movement began in 18th century England thanks to the efforts of a reformer named Robert Raikes, who the religion scholar Martin E. Marty once called “the Eli Whitney or Thomas Edison of the Sunday school.”

Visiting a factory town on business one day, Raikes was appalled by the spectacle of “wretchedly ragged” children playing in the street. When he asked a local about the problem, he was told that on Sundays, it was even worse: “The street is filled with the multitudes of these wretches, who...spend their time in noise and riot, playing at chuck, and cursing and swearing in a manner so horrid, as to convey to any serious mind an idea of hell rather than any other place.”

Raikes’s solution was to provide a school for them to attend on their one day off from factory work. At “Sunday school,” they would learn reading and writing, as well as moral and Biblical lessons. The classes were imbued with an ambient Christianity, to be sure, but their first purpose was to educate the poor.

The idea spread quickly within Britain, and by 1790 a group of Philadelphia Quakers had imported the plan to America. Over the course of the 19th century, Sunday School became increasingly evangelical and less academic. Gradually, respectable church families were encouraged to send their own children to Sunday School.

Still, the mission remained focused on the poor: The American Sunday School Union, established in 1824, made it a goal to establish programs in every needy place between Harrisburg, Pennsylvania, and the Rocky Mountains. One Sunday School booster wrote to The New York Times in 1851 that the city’s children were “a field that needs a faithful and thorough cultivation as much as any along the coast of Africa or Labrador.”

The Sunday School movement was remarkably successful. According to one estimate, about 80 percent of new church members in 1900 first came to church through a Sunday School class. It was also thoroughly woven into the fabric of American life, including its political life. Carter is arguably the most famous living teacher of Sunday School, but he carries on a rich presidential tradition. Zachary Taylor observed a Sunday School program on the day he came down with the mysterious illness that killed him. Franklin Pierce erected the first White House Christmas tree for a group of Sunday School children. Benjamin Harrison taught Sunday School, and so did Richard Nixon in his college years.

Today, there are signs that it’s Sunday School itself that could use some charity. Fewer Americans identify as Christian at all, and Sunday School attendance was already declining when Barna conducted his survey a decade ago. The Southern Baptist Convention—the country’s largest Protestant denomination—reported declines in enrollment every year between 2004 and 2012, prompting a Baptist denominational news service to ask “Can Sunday School be saved?

Leave it to the Baptists to fret about who can be saved. In many quarters, Sunday School is now likelier to be a source of “fellowship”—a social and devotional occasion—rather than primarily educational, let alone charitable. And although Carter’s brand of progressive Christianity is popular in the media, its future as a robust domain of American religious life is still up in the air.

In the meantime, however, the lines outside Carter’s classes these last few weeks may be an encouraging sign for those worried about the future of the institution. Sure, the full parking lot in Plains, Georgia, may say more about affection for the ailing former president than about renewed enthusiasm for Sunday School itself. But it still suggests that under the right conditions, Sunday School can be the hottest ticket in town.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.