“People call this Cabán country,” New York City Councilman Jimmy Van Bramer said, gesturing to the Sunnyside street where he was campaigning with Tiffany Cabán. It was five days before the primary election in which Cabán would emerge as the likely winner in the Queens district attorney Democratic primary, promising to usher in radical reforms such as fewer arrests, shorter sentences and the full decriminalization of sex work. On Tuesday night, Van Bramer’s neighborhood nickname proved name apt – Cabán ran away with Sunnyside in the six-way race, earning 67% of the vote in Assembly District 37, which covers the area.

Her shocking upset was powered by the combination of a charismatic candidate with the right demographic and professional profile and the backing of progressive grassroots groups eager for changes that reflect the borough’s changing population and politics.

Cabán didn’t just do well in Van Bramer’s left-leaning neighborhood – she picked up votes boroughwide, dominating gentrifying western Queens while picking up respectable percentages in the northeastern and southeastern Queens neighborhoods where she wasn’t expected to compete. With more than 98% of vote scanners reporting, Cabán led her main rival, Queens Borough President Melinda Katz, by just 1,090 votes, or just over 1% of the total. Katz hasn’t conceded, and absentee ballots won’t be fully counted for at least another week. But the odds are long for anything but a Cabán victory. That was good enough for her Tuesday night as she declared victory in front of hundreds of supporters at her election night party at a nightclub in Woodside.

The central factor in how Cabán defeated Katz - and her coalition of labor unions, elected officials, commercial interests and thousands of Democratic voters who had known her as their borough president – is Cabán herself.

The first-time candidate turned out to be a gifted public speaker, captivating crowds from the moment she launched her campaign. (Despite a lack of prior political experience, she had been a Manhattan public defender for seven years, making the case for her clients in front of judges.)

Supporters routinely praised her knowledge of the office, her emphatic speaking, in an oft-repeated compliment, of her “authenticity.” The Cabán campaign helped emphasize that by making her various identities central to its marketing effort, which Cabán herself summed up in a sentence in her acceptance speech: “I’m a 31 year-old, queer, Latina, public defender whose parents grew up in the Woodside Housing Projects, and I decided to run.”

Her relatively young age and Latina identity both seemed to help her in a borough where younger candidates and candidates of color are beginning to displace some older white officeholders. But the importance of her queer identity can’t be overstated either, said Zachariah Boyer, a gay activist and member of the Democratic Socialists of America who started volunteering for the Cabán campaign in March. She won, Boyer noted, “after running a grassroots campaign during Pride Month! During the year we’re celebrating Stonewall 50. If people don’t recognize the weight of that, they’re not paying attention.”

A talented candidate alone doesn’t always win massive upsets, however. Cabán chose to run at the right time, in the midst of national progressive movement driving criminal justice reform and after the Queens district attorney’s office had been held for decades by a relatively conservative older white man, Richard Brown. In July 2018, months before Cabán considered running, and almost a year before the scheduled June 2019 primary, more than a dozen progressive local criminal justice reform organizations formed a coalition to push for change in the Queens district attorney’s office. That group, Queens for DA Accountability, declined to line up behind New York City Councilman Rory Lancman. Lancman had been planning a campaign for months by positioning himself as a progressive criminal justice reformer, officially announced a run in September 2018.

When Cabán launched her run, months later in January 2019, Queens for DA Accountability was already there waiting, and quickly embraced her as the candidate that could push for their shared ideas. She earned endorsements from a number of the group’s members, including Make the Road Action, the DSA Queens chapter and the New Queens Democrats. She earned implicit endorsements from others, like Five Boro Defenders, which rated her the highest among all the candidates in its voter guide.

But the organization with the biggest impact on Cabán’s campaign was the Working Families Party, a political party and activist organization with decades of political experience. “Working Families Party saved the day,” said Seth Pollack, an activist and early Cabán staffer who left the campaign in March. “They transformed the campaign from being a bunch of hard-working amateurs to people who had experience and infrastructure.”

Pollack left the campaign during a period of high turnover, where Cabán had three leadership teams in just four months. But the WFP’s endorsement in late April shook up the campaign behind the scenes and brought in some much-needed money. That included direct contributions from the party, but also its donor list.

“When you have these small-dollar donations, it’s not because 5,000 people woke up and read the news and were like, ‘Boy, I want to give money to that Tiffany Cabán,’” Pollack told City & State. “The only way that’s possible is with someone who had a list of tens of thousands of people who might donate.”

The WFP’s fundraising prowess helped fill Cabán’s coffers with money from across the country. Money begets more money, and soon the campaign was a juggernaut. Rep. Alexandria Ocasio-Cortez endorsed Cabán and sent out a fundraising email to her list. On the same day, leading progressive presidential candidates Sens. Bernie Sanders and Elizabeth Warren did the same.

The WFP also helped bring press coverage via Monica Klein, a communications strategist who had previously worked for New York City Mayor Bill de Blasio and state Sen. Jessica Ramos. Before Klein was on board, Cabán got attention from local outlets, including City & State and the Queens Eagle, and from left-leaning outlets like the Indypendent. Afterwards, the Cabán campaign hit the big time, with coverage from The New Yorker, The New York Times, and multiple pieces from New York magazine.

There are a dozen other factors that can help explain Cabán’s victory, not the least of which were the political dynamics among the candidates, with the relatively moderate candidate Gregory Lasak likely winning votes from Queensites who would have otherwise voted for the establishment-backed Katz. But the biggest factor of all seems to have been Cabán’s ground game. According to WFP organizer Ava Benezra, the campaign knocked on more than 120,000 doors in the four days leading up the election, and sent more than half a million texts encouraging votes for Cabán.

That outreach included less traditional approaches as well. Campaigning a few days before the election in Sunnyside, Van Bramer introduced Cabán to Kathleen Essay, who was picking up her 6-year-old from school. “My daughter knows you!” Essay exclaimed to Cabán. “She saw your name written on the sidewalk in chalk. Effective marketing!”

Correction: Cabán was endorsed by Make the Road New York's political arm, Make the Road Action.