In theory, Wisconsin’s primaries aren’t that much of a big deal, with only 138 delegates available across both the Democratic and Republican parties.

But in practice, at this point in the election calendar, Wisconsin matters a lot. And the wins that Ted Cruz and Bernie Sanders clinched on Tuesday night have helped clarify the race to the White House: Sanders isn’t the only candidate who faces an uphill climb to get his party’s nomination – things aren’t going to be easy for Donald Trump either. The New York billionaire increasingly faces the prospect of a contested convention.

The Republican race

Cruz obtained 48% of the votes in Wisconsin, 13 percentage points ahead of Trump (and 34 percentage points ahead of Kasich). Because Wisconsin is largely a winner-takes-all state for Republicans, that vote share was enough for the Texas senator to pick up 36 of the 42 delegates available here. As a result, Cruz has brought up his delegate total to 502. That’s still behind Trump’s current total of 739 delegates but it’s significant because Cruz’s win helps to hold Trump back from that golden finish line: the 1,237 delegates needed to win the Republican nomination.

Polling had predicted a much narrower win for Cruz. Averages collected by Real Clear Politics suggested Cruz would defeat Trump by a margin of less than five percentage points (polls also underestimated the performance of Sanders, who beat Hillary by a margin four times bigger than predicted).

It’s likely that Cruz owes at least some of that success to Marco Rubio’s decision to drop out of the Republican race three weeks ago. A month ago, polling suggested Rubio and Trump were level pegging in Wisconsin. Nationally, it looks as though most Rubio supporters are choosing Cruz as their second choice rather than Trump – last night’s results would suggest that a similar trend happened in Wisconsin.

US election delegate tracker: who's winning the presidential nomination? Read more

Some of that may well be strategic. Republicans who are aware of widely reported polling numbers may feel that Cruz is their best bet for keeping Trump out. Endorsements may also have helped to solidify that perception. Cruz currently has the backing of 39 elected officials while Trump and the Ohio governor, John Kasich, both have 11. Such factors might well be influential in Wisconsin where voter turnout was 73.2% in 2012 (the second-highest state figure in the country) – but they might not necessarily be as important elsewhere. Similarly, Cruz might have found it easier to collect votes in a state that is 71% Christian than he will in two weeks’ time in New York, where just 60% of adults are Christian.

Surveying six political experts, FiveThirtyEight projects that the 16 remaining Republican races will bring Trump to a delegate total of 1,201 – just shy of the 1,237 he needs to get the party’s nomination. Those experts could be wrong, though; Trump might still manage to inch across the finish line. Either way, the upcoming Republican primaries will be closely watched.

The Democratic race

Despite coming first, Sanders too had a difficult night. The Vermont senator won 57% of the vote, significantly ahead of Hillary Clinton who won 43%. Unlike the Republicans, Democrats divide delegates according to vote share. So in the end Sanders was able to add 45 pledged delegates to those he had gained in the primaries so far. That still leaves Sanders trailing 249 delegates behind the former secretary of state (and with an even larger gap to make up of 687 delegates once you account for Clinton’s huge lead in superdelegates, party elites who are not bound by primary results).

That said, Sanders is not out yet. In his speeches, Sanders’ rhetoric has focused on the idea of himself as the underestimated underdog who is building “momentum”. He has a point. While it’s true that current polling suggests it will be very hard for Sanders to catch up with Clinton, the socialist candidate has already exceeded all expectations and may yet continue to do so.

Of course delegates and vote shares are what counts politically but ballot papers should matter too – if nothing else, because they represent individual voters. On that measure, too, Sanders has much ground to recover. Clinton has gained 2.5m more votes than Sanders in the primaries held so far.

Wisconsin’s results show that the contest to be chosen as a presidential nominee in 2016 is still competitive. In yet another strange twist of this election, after Wisconsin both Trump and Sanders need 58% of remaining delegates to win their party’s nomination. And in both cases that will be tough. No candidate can afford to rest on their laurels and no pundits can afford to write anyone off until the math shows they truly have zero chance of winning.