As momentum builds among Britain’s Conservative MPs to challenge Theresa May’s premiership, her party is in danger of finding itself on the wrong side of history. Its annual conference, held this year in Manchester, displayed the problem. The great majority of party members who gathered for the event were elderly. This is not because younger members were too busy earning a living to attend: it is because of what has happened to the party’s grassroots.

The Conservative Party is the biggest in parliament, but probably only the fourth largest in terms of local membership. Having peaked at almost three million in 1953, it is now estimated to be only 100,000 and still falling. It is far smaller than the Labour Party, which now has more than half a million members, and may now be smaller than both the Liberal Democrats, which has just 12 MPs, and even the Scottish National Party, which operates in only one-tenth of the United Kingdom.

As the Conservative Party shrinks, the average age of its remaining members rises. A recent YouGov survey for the Times found that 59 percent of the Conservative’s members are over 60, and only 18 percent are under 40.

In some ways, this is not so much a new problem as the intensification of an old one. Even in Margaret Thatcher’s heyday in the 1980s, older members of the Conservative Party outnumbered younger ones—but there were far more of them (1.2 million in 1982), and the age profile was not as skewed as it is today.

However, there is now a new dimension to the problem that has been thrown into sharp relief by the growing likelihood that Theresa May is unlikely to last much longer as party leader and prime minister. Even before May’s disastrous end-of-conference speech, which she had difficulty finishing because of a coughing fit and which was interrupted by a comedian giving her a mock dismissal notice, the prime minister’s authority had been drained by off-message remarks about Brexit by Boris Johnson, Britain’s foreign secretary. Any other prime minister at any other time would simply have sacked Johnson for insubordination. May is too weak to do so without risking an immediate challenge to her own position.

The underlying problem is that age has become by far the biggest dividing line in British politics—far bigger than social class, which used to divide mainly working-class Labour voters from mainly middle-class Conservative voters. That dividing line affects attitudes toward Europe, not just party loyalties. In last year’s referendum, voters under the age of thirty-five voted by almost two-to-one to remain in the European Union, while voters over fifty-five voted strongly to leave the EU.

In this year’s general election, the Conservatives won only 20 percent of the vote among people under the age of thirty-five, but 50 percent among people over fifty-five.

These two sets of figures are connected. The age gap has widened enormously since the last general election two years ago—and Brexit has been the driver. Younger voters who want the UK to stay in the EU deserted the Conservatives in large numbers this year, while older, pro-Brexit voters shifted to the Conservatives, also in large numbers.

This means that Conservative Party members who overwhelmingly back Brexit are on the same side as voters of the same age but on the opposite side to younger voters with regard to the biggest challenge facing the UK in the current parliament. Looking to the future, this has profound lessons for the Conservative Party, and for Britain more widely. People under the age of forty—those born since the late 1970s—have grown up in a multiracial Britain; they are used to travelling in Europe and more widely; and many will end up spending at least part of their adult lives studying and/or working abroad. They rejoice in their internationalism. The nationalist, little-Britain sentiments that drove the Brexit vote are anathema to them. Here is the clincher: the internationalist generation numbers look certain to grow, as new people attain voting age, while their parents and grandparents progressively die out. In short, the UK is negotiating to leave the EU at precisely the point in the country’s history when the appeal of anti-European nationalism is in terminal decline.

Meanwhile the choice of Britain’s next prime minister will be decided ultimately by people who are virtually immune to these long-term forces—the ageing members of the Conservative Party. Under party rules, Conservative MPs decide which two candidates for the leadership go forward to the wider party membership. As things stand, the winner will be whoever of the two takes the harder anti-Brussels line. If one says that the UK should consider a trade deal that looks similar to the current single market and customs union, they are almost certain to lose out to a rival who rules out any such deal.

Those who hope, or fear, that Britain’s next prime minister will be Boris Johnson can rule out that prospect. Theresa May may be too weak to sack him, but Johnson’s recent behaviour has irritated many Conservative MPs on both sides of the Brexit debate. Britain’s foreign secretary is now most unlikely to be one of the two candidates that MPs offer to party members.

What then? If the UK acquires a strongly pro-Brexit prime minister (unlike May, who supported the pro-EU campaign last year, albeit weakly), then the chances rise that current talks with the EU will either run into the sand, or result in a deal that is bad for trade, jobs, and investment. Such a deal may satisfy elderly Conservative Party members, but not voters under the age of forty—and possibly not Parliament (when the views of MPs from all parties are taken into account, pro-EU MPs are in a clear overall majority). The UK could then enter a period of profound uncertainty, with another general election, a fresh referendum, and a realignment of political parties all becoming possibilities.

All told, the Conservative leadership drama seems to be heading to an earlier resolution than looked likely in September. But it is anyone’s guess what condition the government and its plans for Brexit will be in twelve months from now, and what Britain’s relationship with the EU will be in the longer term when the UK’s internationalist generation becomes a clear majority.

Peter Kellner is a journalist, political commentator, and former president of YouGov.