The Democratic Party made itself vulnerable to Donald Trump’s insurgency by cultivating Wall Street, wealthy political donors, and other financial elites despised by the American public.

Trump’s “drain the swamp” rhetoric — his promise to rid Washington of insider corruption and throw the money lenders out of the capitol — was almost certainly political grandstanding. Trump is already using lobbyists to staff the next government, and Chris Christie, a leader on his transition team, is mired in corruption scandals.

But strategically, Trump’s criticism of “the political establishment” clearly worked, according to nearly a dozen political scientists and campaign finance experts I interviewed for this story.

It first worked in the primary against the Republican politicians whose billionaire backers poured dark money into politics. Then it worked again against a Democratic Party that, by acquiescing to the new rules created by the GOP, became roughly as tethered to superwealthy donors and Super PACs (albeit different ones) as Jeb Bush and Marco Rubio.

“Democrats exposed themselves to Trump’s ‘anti-corruption’ message. They went on and on exploiting the system for themselves, and that made this line of, ‘Oh, I may be part of this, but I really am against it!’ very difficult for the voters to believe,” says Lawrence Norden, deputy director of the Democracy Program at the Brennan Center, in an interview. “And understandably so.”

The evidence is strong that Trump’s “anti-corruption” message resonated politically

In his final television ad of the campaign, Trump returned to the case he first began making to a few hundred people in New Hampshire more than a year ago — that the global financial and political “establishment” had conspired to sap America of its vitality, and that only he could stop them.

“The establishment has trillions of dollars at stake in this election. … For those who control the levers of power in Washington, and for the global special interests, they partner with these people that don’t have your good in mind,” Trump says in the ad, while images of Wall Street bankers and the Clintons flash on the screen. “Our movement is about replacing a failed and corrupt political establishment with a new government controlled by you, the American people.”

It was the only ad he ran in some states for the past two weeks of the campaign. It did not mention Republican tax plans. It contained no attacks on Obamacare. It didn’t touch on the Muslim immigration ban.

“Without some of the anti-Semitic overtones, it could have been run by Bernie Sanders or Elizabeth Warren,” says Matt Grossmann, a political scientist at Michigan State University. “It was very effective at linking DC to global political elites to the economic forces that are hurting people.”

Even before Trump, it was clear that voters overwhelmingly fear the influence of bankers and other donors on the political system, says Lisa Gilbert, a campaign finance expert at the transparency organization Public Citizen. Polling pegs nearly 90 percent of the public as saying Super PAC spending on elections is a growing concern. It shows that three-fourths of members of both parties say corporate political contributions “will lead to corruption.”

“There’s a real unanimity in the public that Washington is broken because the oligarchs control it,” Gilbert says.

On essentially every issue in the campaign — temperament, intelligence, judgment, experience, race relations, combating crime — Clinton consistently ran ahead of Trump in public polling.

But there was one consistent exception: which candidate would reduce “special interests” in Washington. It’s the sole issue on which Trump routinely defeated Clinton in both Gallup and Pew polling, and often by double-digit margins:

More than 60 percent of Americans did not believe that Clinton would remove money's influence from politics, according to Quinnipiac polling. Just 15 percent of Americans thought she'd even try to rein in Wall Street, says Tyler Creighton, senior media associate at the nonprofit ReThink Media. One extensive MSNBC report found that during the Republican primary, Trump’s attacks on special interests and political money were the single biggest reason voters thrilled to his candidacy.

“The polls are uniform that regardless of your partisanship, people are very unhappy with the current campaign finance system and believe big money has too much influence over it,” says Norden, of the Brennan Center. “There is no question Trump and Bernie Sanders both ran on the message that big money has too much influence over the campaign finance system. It’s not an accident that they resonated with voters.”

Of course, this is not the only reason Donald Trump will be our next president. Elections are complicated, and the race was close enough that any number of things could have made the difference.

But Trump’s crusade against special interests was clearly a major source of his appeal, says Matt Dickinson, a Middlebury College political scientist who spent months at Trump rallies and interviewed hundreds of his supporters.

“Almost to a person, they were obsessed with this idea that the economic and political elites were in cahoots with each other,” Dickinson said. “Trump would talk about how you had to give money to gain access to these people, and the crowd would roar. That was his great appeal: ‘I was part of that rigged system, and all of your fears about it being rigged are right.’”

Democrats did not have a “special interest” problem — as long as they faced Mitt Romney and Jeb Bush

This used to not be a political vulnerability for the Democratic Party. Over the past two decades, Republicans have led the charge for opening politics to big-money donors — and Democrats have resisted it.

In a 2006 case revisiting Buckley v. Valeo, the Republican-appointed justices struck down election-related spending limits as unconstitutional. The conservative justices of the Court then pulled the floodgates open wider for endless spending of dark money — which doesn’t have to be disclosed — in the 2010 Citizens United case. Democrats called for an immediate repeal of the decision, while the GOP’s position, at least pre-Trump, was that restrictions on cash going to politicians represented an assault on free speech.

But unable to stop that surge, Democrats quickly acquiesced to the new reality — taking corporate donations for congressional races, setting up dark money Super PACs, and allowing lobbyists to underwrite their conventions.

And from their perspective, why not? As long as the Republican Party was being run by the likes of Mitt Romney and Mitch McConnell, doing so didn’t pose a threat to their larger political project. Even with President Barack Obama’s decision to accept corporate political contributions, his Republican opponents did so to an equal or greater extent — making the issue, at worst, a wash for them.

“Both sides have pretty much taken advantage of whatever has been available to them,” says Brendan Glavin, of the Campaign Finance Institute, in an interview. “At least until Bernie and Trump this year.”

In 2008, for instance, the public trusted Barack Obama to take on “special interests” by 14 points more than they trusted John McCain to do the same:

The story was much the same four years later. In 2012, Americans listed corruption as the second-highest priority when considering the next president, only behind jobs. And Obama consistently ran well ahead of Mitt Romney on the questions of tackling government corruption and rooting out special interest influence, according to Gallup polling:

Many Democrats tried playing Republicans’ game because they thought it was the best thing to do

It’s easy for left-wing critics to be cynical and dismissive of Democrats’ decision to make peace with big-money donors.

But it’s worth remembering that many of the Democrats who bent to the new rules of campaign spending did so because they genuinely thought it was the best thing for the country. Democrats on the Hill I’ve spoken to expressed real terror that if they ceased doing the very fundraising they themselves condemned, the party, and the country, would face the worse outcome of Republicans spending their way to a sweep of government.

This is the answer Oregon Sen. Jeff Merkley kept returning to when we talked about money in politics this September. (“What I struggle with, and what many of my colleagues struggle with, is we have Senate rules that we believe should be changed. But until they are changed, how much unilateral advantage do we give to Republicans,” said Merkley, who endorsed Bernie Sanders in the primary.) And in interviews after they left Congress, many congressional Democrats express a deep-seated contempt for the fundraising apparatus that makes them spend hours groveling on the phone for dough.

But even if they hated it, the Democrats made peace with big money’s role in politics. And that, in turn, weakened their credibility to stand against it.

“Democrats had this line of, ‘I can’t unilaterally disarm, but trust me, I really want to change the system.’ And that made them vulnerable to this by making their talk just look like it’s just lip service,” Norden says.

Hillary Clinton could never credibly attack the political and financial establishment

The Democratic Party could have gone another way this year.

Bernie Sanders made standing against special interests and rich donors in politics a key plank in his campaign. He famously refused to accept corporate campaign contributions or those from "millionaires and billionaires." He built a campaign fueled entirely by small-dollar donors (famously contributing an average $27). It all fit naturally with his message that the 1 percent had come to control the US government — and that only someone outside of it could puncture its corrosive hold.

This was a persuasive argument to many rank-and-file primary voters, but Democratic Party leaders largely saw it as irrelevant. They were concerned that Sanders’s unapologetically left-wing views on a range of issues — not just economic populism but a carbon tax, reentry into the country for already-deported undocumented immigrants, blanket opposition to the death penalty, etc. — would render him unelectable.

The notion that Sanders’s clean-hands positioning would be a major upside was largely dismissed by a party leadership that had grown accustomed to simultaneously depending on massive fundraising while also owning the issue of standing up to the special interests.

But Republicans wound up nominating Donald Trump, who offered a version of a Sanders-style critique of Clinton as a tool of big-money interests. Sanders might have been able to counter that argument, but Clinton couldn’t and never really tried.

Instead, she settled on a strategy of trying to bury Trump under a fundraising advance that’s essentially unprecedented for a Democrat. She had a 20-to-1 fundraising edge among billionaires, and an even bigger one among top corporate earners. She spent much of her summer off the campaign trail fundraising with some of the wealthiest people in America. (“Where has Hillary Clinton been? Ask the Ultrarich,” wrote the New York Times, citing a two-week spree in which Clinton raised $50 million with 22 events.)

WikiLeaks emails made clear that her team has been in close contact with superdonors even when crafting and considering policy. She also differed from her Democratic predecessors in that she didn’t just rely on the wealthy for campaign contributions but also spent several years before her presidential run making big bucks on the corporate speaking circuit.

“Even as they deride big money in politics, Democrats trying to help elect Hillary Clinton have fully embraced the Supreme Court's Citizens United and McCutcheon decisions,” Michael Beckel, a campaign finance expert at the Center for Public Integrity, tells me. (The Citizens United and McCutcheon rulings rolled back major restrictions on political donations.) “Many Democrats on Team Hillary have decided to fight fire with fire.”

And in narrow terms, it worked. Clinton outraised Trump by an impressive margin, and was even able to spare money for cash-strapped down-ballot Democrats. Her party picked up two Senate seats and a handful of House seats, and won the popular vote. But they lost the brand as the party of clean government, and lost just enough Obama voters in the Upper Midwest to lose the presidency.