IT IS a measure of Labour’s sorry state these days that losing just one of two seats that it has held for decades is treated as grounds for relief in the party. In the by-elections held yesterday, both triggered by the resignation from politics of centrist MPs known to despair of the party’s direction under Jeremy Corbyn, Labour held Stoke Central on a reduced vote share (37%, down from 39%) and lost Copeland to the Conservatives, whose vote share rose eight points to 44%. The Labour leader’s past opposition to nuclear power (the main employer in the Cumbria seat) and his party’s confused stance on Brexit (the seat voted to leave the EU) were both factors in the results.

Still, the biggest loser of the night was UKIP. Paul Nuttall, the party’s leader (pictured above), put his credibility on the line by running for Stoke Central, which his party referred to as the “capital of Brexit” to honour its strong support for leaving the EU last year. But his campaign was a reminder that, for all the headlines UKIP generates, it is terrible at the dull and disciplined business of campaigning: Mr Nuttall’s ground operation was poor and his campaign was mired by claims that he had lied on his website. Some in the party must be wondering where it can win, if not in somewhere like Stoke Central.

Yet to some extent, at least, UKIP is the victim of bigger forces—forces which give Theresa May much to celebrate. Indeed, the prime minister was surely the big winner of the night. Copeland (and its predecessor seat, Whitehaven) had been held by Labour since 1935; moreover this was time first time a sitting government had gained a seat in a by-election since 1982. The Tories also almost beat UKIP to second place in Stoke Central. The prime minister had campaigned in both seats. With Labour’s results bad enough to confirm that they are stuffed under Mr Corbyn but not bad enough to force him out, the night’s outcomes weaken her already weak opponent and keeps him in place. She must be delighted.

The result confirms a structural shift in British politics since the EU referendum. Under David Cameron the Tories struggled in working-class seats, especially in the Midlands and north, and leaked support on their right-wing flank to UKIP. By giving UKIP voters what they want, Brexit has reunited the right. Mrs May has deliberately helped this process along, tacking right on social issues (making reducing immigration her highest priority in the coming Brexit talks, for example) and left on economic ones (hailing a more interventionist industrial strategy to revive manufacturing). These have swept working-class conservatives back into her party’s fold, pushing it above 40% in most polls and carrying it forward in yesterday’s by-elections (and across the line in Copeland).

If UKIP is not the nightmare for Mrs May that it was for Mr Cameron, and Labour is in the doldrums, perhaps the rival party that should concern her most is the Liberal Democrats. Tim Farron’s party has been storming ahead in recent by-elections. Though neither are natural Lib Dem seats the party doubled its vote share in Copeland and more than doubled it in Stoke Central (seemingly doing especially well among students; a reminder that Labour too needs to watch out). The Tories won their current majority in 2015 with the borrowed support of Lib Dem voters in London (particularly the affluent south-west) and south-west England. The loan is not permanent: many of the seats voted to Remain in the EU and could switch back to Mr Farron’s party at the next election. Mrs May seems to have vanquished UKIP. For her party, the new electoral battle is on a different front.