For the first time since the 19th century, a British political party has gained seats when seeking a fourth term in office. The Conservatives’ share of the vote, 44%, was their highest since 1979, and their seat total – 365 – was their best since 1987. They achieved all of this despite 72% of voters disapproving of the government’s performance, despite Boris Johnson’s negative approval rating, and despite nine years of austerity.

How did this happen?

Many observers have declared that the 2019 result was down to the unpopularity of one person – Jeremy Corbyn – and that Labour’s leftwing policies meant that the party was unelectable. One problem with this is that Labour’s policies are, in fact, overwhelmingly popular: significant majorities of voters support funding the NHS, raising the minimum wage, building council homes and other such social democratic policies.

While the evidence shows that Corbyn’s leadership was unpopular, this sense of leadership was profoundly linked to his Brexit position, gifting the Conservatives the “dither and delay” line they were able to use so effectively. And I believe this – Brexit – provides the most plausible way of summing up Labour’s defeat in one word.

Precisely, the problem was that Labour massively underestimated how much leave voters wanted Brexit, while overestimating how much remainers wanted to stop Brexit. Millions and millions of people still want Britain to leave the EU. In December thus far, remain is averaging 53% and leave is averaging 47% in polls; although remain is ahead in the polls, leave voters showed that they were prepared to vote collectively to ensure that Brexit happens. Remain voters, however, showed that they were not willing to vote collectively to stop Brexit.

In 2017, Labour won 41% of the vote by winning the support of 55% of remain voters and 24% of leave voters. In 2019, according to a post-election poll by YouGov, Labour won 49% among remainers (-6pts), with 21% of remainers voting Liberal Democrat (+9pts) and 19% supporting the Conservatives (-6pts). Labour’s lead over the Tories among remainers in 2019 (30pts) was thus exactly the same as in 2017 (30pts). But among leave voters, the Conservatives’ lead over Labour increased from 41pts to 60pts, with the party winning 74% of the leave vote (+9pts), and just 14% voting for Labour (-10pts). Just 17% of the voters who supported remain in 2016 and Labour in 2017 voted for an explicitly pro-remain party in 2019, that is to say the Lib Dems, Plaid Cymru, SNP or Green. But 39% of those who voted leave in 2016 and Labour in 2017 supported an explicitly pro-Brexit party in 2019.

Meanwhile, of the 54 seats that the Conservatives gained from Labour, 52 of them were in areas that voted leave in 2016; the Tories only gained two seats that voted remain from Labour, both by small margins, and in both of those seats the Green party vote was larger than the Conservative majority. In total, the Tories won 65 seats in which the combined Labour, SNP, Lib Dem, Plaid Cymru and Green vote was larger than the Conservative vote. If remainers had been united, the Conservatives would have won 300 seats and the other parties would have won 331, the 18 Northern Irish MPs and the Speaker making up the rest of the 650.

So what can Labour learn for 2024?

First, Corbynomics was not the reason for Labour’s defeat: 81% of voters support an increase in spending on the NHS, 66% support tax rises for those earning more than £80,000 a year, 66% support building 150,000 council homes and 59% support a green industrial revolution. Labour’s policies are popular, and it is worth noting that Labour won more votes with a leftwing manifesto in 2019 than it won with a centrist manifesto in 2015 and 2010. Abandoning Corbyn’s policies and returning to a centrist policy agenda will not gain the party votes. The fact that the Lib Dems gained no seats in the 2019 election shows that the electorate has no interest in centrist policies.

Second, the 2019 election has effectively made it impossible for Labour to win a majority in 2024. To win 326 seats, Labour would need to gain 124 seats, including 35 seats that it lost by 15pts or more last week. The last time that Labour gained that many seats was in 1997. It is, of course, possible for Labour to return to power as a minority government, but a Labour majority is very unlikely.

Third, Labour did not lose as a result of being insufficiently pro-remain. The party’s lead over the Conservatives among remain voters (30pts) was unchanged from what it was in 2017, and Labour lost far more leavers than remainers. And of the 124 seats that Labour needs to gain in order to win a majority in 2024, 86 voted leave. Electing a pro-remain centrist as leader is not the solution: Labour must focus on winning back leave voters.

Finally, Labour should look to the future; it should not become obsessed with Brexit. The next election will take place four years after Brexit, and the question of whether we will leave or remain will have been definitively settled. Labour will not win in 2024 by quixotically re-running the 2016 referendum over and over again; it will only win if it looks forward to the future, and champions a leftwing vision for Britain’s future outside the EU.

• Ell Smith is the founder of Stats for Lefties, a blog and podcast that examines polls and elections