Joe Biden’s advantage over Bernie Sanders in head-to-head polling against Trump has collapsed.

Biden’s margin of victory against Trump has plummeted from a rolling average of 10 in mid-October to 4 at the end of January. That’s the same margin that Bernie Sanders wins against Trump, based on polling aggregated by Real Clear Politics. The two perform so similarly against Trump that Sanders has actually outperformed Biden in recent head-to-heads.

These numbers tell the story of a Biden campaign that stayed above the fray for most of 2019 — only to falter in October. That’s when Trump unleashed a wave of attack ads accusing him of corrupt dealings in Ukraine. An analysis of Trump’s digital spending shows a significant spike coinciding with Biden’s deterioration in the polls:

Meanwhile, just a Trump’s onslaught began, Biden faced a financial crisis. At the start of October, his campaign announced that it had only raised $15.9m in the third quarter – and had less than $9m left in its war chest. These dismal numbers spooked elite donors and likely led to Michael Bloomberg’s entry into the race. But just as importantly, Biden’s diminished fundraising coincided with what the New York Times called a “striking” decline in digital advertising. The lack of support for Biden clearly impacted his ability to respond to Trump’s attack:

Mr. Biden and other candidates will start announcing fund-raising results as early as Tuesday morning for the third quarter…He was only the sixth-biggest Democratic spender on Facebook ads in the seven days ending Saturday, even as he began spending more money on digital ads targeting President Trump, Ukraine and impeachment.

Trump also took aim at Bernie Sanders during his fourth-quarter offensive. In fact, an analysis by Fast Company’s Mark Sullivan found that

Despite the casting of Joe Biden as Trump’s “main rival” in the Ukraine debacle, Sanders is the Dem who appears far more often in the Facebook ads.

Nevertheless, Sanders’ polling only declined 2 points from mid-October to the end of January, compared to the 6 point decline by Biden. And during those three months, Sanders outperformed Biden against Trump twice. First came a November poll by Emerson that showed Biden losing to Trump, with Sanders winning by a slim 1 point margin. And at the end of January, Newsweek reported Sanders beating Trump “by the widest margin of all the candidates in the Democratic Party’s 2020 race”: Sanders beat Trump by 9 points, while Biden won by 7.

If you compare Sanders’ digital spending with Biden’s, it’s not difficult to see why he’s fared so much better against Trump:

While Biden has struggled to raise money, Bernie Sanders’ grassroots fundraising juggernaut continues to break records. To date, Sanders has raised $108 million, compared to $60 million by Biden. And Sanders has overwhelmingly relied on small contributions from an enormous pool of donors rather than big checks from a limited pool of donors. The New York Times reports that Sanders has 1.4 million donors by the end of the year, versus 500,000 for Biden. Donors to Bernie Sanders (overwhelmingly working-class voters) have given him 5 million contributions averaging $18 each.

There are many reasons why Bernie Sanders would outperform Joe Biden against Donald Trump — and a major difference between the two candidates is already clear. Sanders has an enthusiastic donor base that has empowered him to fight back against Donald Trump in a way that Joe Biden cannot. That’s why Sanders has been able to withstand Trump’s onslaught of attacks even as Biden, like Clinton before him, is watching his lead collapse.