On June 21, 2005, the luminaries of the gay rights movement huddled together in a Jersey City hotel room to plan the future. After years of calamitous losses in the courts and the legislatures, gay rights advocates had finally scored two wins, with gay marriage in Massachusetts and sexual liberty at the Supreme Court. Now, however, their opponents were riled up as never before, working furiously to repeal their victories. The key to success from here, the group decided, would be to focus primarily on expanding marriage equality. If gay marriage could come to 10 states by 2020, victory nationwide would not be far off.

Today, 32 states and the District of Columbia grant full marriage rights to their gay citizens. That number is growing almost every week, and by now even virulently anti-gay politicians are conceding that marriage equality across America is inevitable. To many casual observers, this sudden burst of equality feels both shocking and lucky, as though the gay rights movement’s time had come and no one could stand in its way. But as Marc Solomon’s gripping, fist-pumping new book Winning Marriage illustrates, there’s nothing particularly lucky about the current moment at all. Everything that’s happened over the past few years—from the legislative showdowns to the monumental court rulings—was all plotted out in that 2005 document. The only thing its drafters got wrong, it turns out, was the timeline.

Solomon is in an excellent position to walk us through this saga. The national campaign director for Freedom to Marry, the visionary gay rights group that forced marriage to the front of the debate, Solomon was on the ground shaking hands and leading rallies during the most dramatic points of the marriage crusade. Wisely, he devotes the bulk of the book to three political battles—Massachusetts, New York, and the 2012 ballot initiatives—which, with their heady mix of realpolitik and civics-based morality, read like Aaron Sorkin film treatments. There’s none of the distorted, myopic nonsense that dominated Jo Becker’s disastrous attempt at penning an inside-access, behind-the-scenes gay marriage history. Becker embedded herself with political operatives; Solomon stormed statehouses. This is a people’s history of marriage equality.

That can make for rough sledding, of course, because until quite recently, the people didn’t particularly like gay marriage. Solomon opens the book with “the decision heard ’round the world”—the Massachusetts Supreme Judicial Court ruling that brought marriage equality to the state. Before gay couples had a chance to marry, the Legislature called a constitutional convention and voted for an amendment to ban gay marriage. Conservatives, led by Gov. Mitt Romney, then launched a campaign to unseat every legislator who had supported marriage equality. That campaign failed—thanks to the early intervention of the first functional gay rights coalition. The next year, the amendment was voted down at another constitutional convention.

But not for Solomon and his allies. The devastating defeats of 2004 through 2010, the backlash, the demoralization: They foresaw all of it. The movement would face its share of setbacks, they realized; the key, Solomon writes, was “staying the course,” building the momentum to create a “critical mass” of support that the Supreme Court couldn’t ignore. And as thrilling as the victories are in Solomon’s book, the losses are equally fascinating. After the 2004 Massachusetts constitutional convention, it seemed that married gay couples would soon have their unions invalidated, as allies in other states abandoned the cause in fear. But among activists, there’s no keening or kvetching. There’s only the constant question: What now? Veteran Democrats voted against gay marriage—find a liberal to crush them in the primary. A swing vote leans against marriage equality but loves Broadway—have the gay author of Wicked send him an email. (“You can tell fromWicked the play that my heart is very much with the underdog.”)

This is democracy at its quirkiest and most charming. In the early days, a big defeat could send the message that gay marriage was a political stinker; a big win, on the other hand, could inspire millions of supporters across the country. In states like Massachusetts, all that stood between the two outcomes was a couple of state legislators, elected by a few thousand people, who had never thought about the issue before. Solomon’s account of this hyperlocal lobbying is sometimes hilarious and often deeply moving: We get to listen in as legislators shift from casual agnosticism to the total conviction that gays deserve the right to marry.

More importantly, Solomon’s narrative serves as an important corrective to the lofty notion—most egregiously espoused by Ted Olson and David Boies’ ridiculously muddled book—that the arc of the moral universe bent toward marriage equality on its own, and only needed a few canny lawyers to finish the job. America’s increasing acceptance of gay rights didn’t descend silently like snow in the middle of the night. It arose out of the grueling, indefatigable campaigns by groups like Freedom to Marry, whose activists spent thousands of hours bending that arc with their own hands. As Solomon painstakingly illustrates, these groups lobbied legislatures literally vote by vote, reached out to every voter in every district, rallied and paraded while a majority of the country shrugged or scowled. The gay rights coalition needed to build a groundswell in favor of marriage equality. This, they decided, was the only way to do it.

And, after the brief glimmer of hope in Massachusetts, they failed, over and over again, crushingly and decisively—until, suddenly, one day, they won. In 2011, almost exactly 6 years after the Jersey City meeting, a bare majority of legislators made New York the largest state with marriage equality. It was the moment the gay rights luminaries had been waiting for: the threshold when gay marriage seemed like a potentially winning issue—not just for liberals, but also for conservative Democrats, and even a few moderate Republicans. From there, the push for marriage equality went truly national: to ballot initiatives, to light blue and purple states, and, of course, to the courts.

Solomon smartly refrains from diving into the granular details of the judicial struggle for gay marriage; his, after all, is a political history, not a legal one. And because the political battle for marriage equality appears to be basically over—the issue is now firmly in the hands of the courts, as some conservative legislators have noted with relief—Winning Marriage may well stand as the definitive political history of marriage equality. It’s certainly the book that leaders of the movement deserve, and that latecomers to the movement need to read. After each new pro-equality court ruling, Americans seem to look around in wonder and ask, How did we get here? With this riveting, passionate book, Solomon has provided the answer.

Freedom to Marry was the campaign to win marriage nationwide. With the Supreme Court victory on June 26, 2015, the work of this strategic campaign – though not the larger movement – was achieved, and Freedom to Marry wound down its operations, closing in early 2016. For inquiries, please email legacy@freedomtomarry.org.