On Election Day, voters in Maine, Maryland, and (in a tight vote where mail ballots continue to be processed) Washington made history when they voted to allow same-sex couples to marry.These ballot measures were the first state-wide votes approving same-sex marriage, which had been enacted previously only through legislative or judicial actions. Minnesotans also changed gay politics: they were the first to reject a proposed constitutional amendment to ban gay marriage. (Half the states have approved such amendments, which have almost always passed with easy majorities.)

Over the past 15 years, Americans have become steadily more supportive of marriage rights for gay couples. According to Gallup, exactly half the country now supports legalizing gay marriage. But it took years for popular opinion to change, so gay-marriage advocates fought most of their battles in courts and, later, legislatures. (The first state to legalize gay marriage was Massachusetts, whose Supreme Judicial Court ruled in 2004 that it is unconstitutional to deny marriage licenses to gay couples. The Vermont legislature was the first to authorize gay marriage without being forced to do so by a court.)

But in national politics, gay marriage has remained a delicate topic. President Obama declined to endorse equal marriage rights until May, as he was raising millions of dollars for the fall campaign. Some observers pointed out that gay men provide a disproportionate amount of funding for the Democratic Party. For his part, Obama told ABC’s Robin Roberts that his thinking had undergone an “evolution” on the issue of gay marriage partly because of discussions with his wife and children.

The wins on Nov. 6 will make it easier for future national politicians to support marriage equality. Popular votes provide durability in a way that executive orders, court rulings and legislative measures cannot. “It’s the single biggest talking point that anti-gay groups use in city halls, legislatures, Congress: you don’t have a popular vote,” says Chad Griffin, president of the Human Rights Campaign (HRC), the largest gay-rights group in the world. “Taking that talking point away from them is important.”

One of Griffin’s most dedicated opponents agrees: Speaking on election night, Chip White, a spokesman for Preserve Marriage Washington—which opposes gay marriage—was mindful of history: “It would be the first time that the voters—the people—voted to redefine marriage,” he told me. “It’s always been judges and politicians who have imposed homosexual marriage.”

Judges began to “impose” gay marriage in 1993. That year, in a shocking decision for both sides, the Supreme Court of Hawaii—which had never even considered a gay-rights case—declared that officials who denied marriage licenses to gay couples were violating the state constitution. The justices asked for more debate in the legislature, and they ignited a battle for which neither side had prepared.

Five years later, Hawaii held the first U.S. vote on gay marriage. The gay side lost 2 to 1 even though HRC spent $1 million—a backbreaking amount for the Washington lobby, which struggled afterward. Their money couldn’t trump cheap, simple ads from the other side—one depicting a young boy reading with confusion from a book about two men raising a child. “If you don’t think homosexual marriage will affect you,” an announcer said, “how do you think it will affect your children?”

Another enormous failure came for the pro-gay side in 2008. That year, three states—Arizona, California, and Florida—voted to change their constitutions to make marriage available only to opposite-sex couples. In Florida—which has a large population of gay people in Miami and Orlando, both entertainment hubs—the amendment passed 62% to 38%. The defeat in California was so dispiriting that gays protested not just in that state but also in New York City, where streets had to be closed for the throngs. Nothing like those protests had happened since the assassination of Harvey Milk, the first openly gay man elected to any significant political office. (Killed along with Mayor George Moscone, Milk was a member of San Francisco’s Board of Supervisors.)

The curious part for gay activists was that by the late ’00s, they had little problem raising money. In fact they didn’t know how to spend it all. By 2012, partly because of donations from gay donors, Wisconsin Representative Tammy Baldwin looked to be in a solid position to win one of that state’s U.S. Senate seats (she beat Tommy Thompson, former Secretary of Health and Human Services, by a comfortable 51-46 margin).

Still, marriage was always the most difficult problem. Previous strategies that had used ads to emphasize legal and judicial equality had failed to motivate voters. This year, the messaging changed. Evan Wolfson, 55, the Harvard-educated founder of the group Freedom to Marry, helped convince others in the gay-rights movement to use ads that featured loving couples and the importance of commitment. “We made a real connection on emotion,” he says. Also, all that gay money had allowed for a robust ground campaign. “We put a political campaign in place in Minnesota over a year ago,” says Wolfson, one of the most powerful gay-rights organizers in the country.

Later this month, the U.S. Supreme Court is set to consider various measures that would allow or deny gay marriage on a national level. The justices will spend most of their time writing about the legal and judicial aspects of each measure. But it may be important to some of them that popular majorities were willing to vote for marriage equality just a few weeks before. “After [Election Day], the gay marriage debate won’t be same,” says Griffin of the Human Rights Campaign. “We changed it.”