If Theresa May survives the next ten days as Britain’s prime minister, she is probably safe for the next few months—although her medium-term prospects are altogether bleaker. The reason for her short-term survival can be found in three central facts at the heart of UK politics following the June 8 general election.

First, as long as Northern Ireland’s Democratic Unionist Party (DUP) is willing to sustain the Conservatives in office, the government is most unlikely to be brought down by defeat in the House of Commons. The House of Commons has 650 members. Seven belong to the Irish republican party Sinn Féin, which never takes its seats at Westminster because it opposes the parliament’s jurisdiction in Northern Ireland. So the effective total is 643. Of these, 318 are Conservative, 314 belong to one of the anti-Conservative parties on the British mainland, ten are from the DUP, and one is an independent. As long as the DUP members vote with the Conservatives, the government has a majority of thirteen. If they abstain, the majority falls to three, but the Tories can still hold on. Only if the DUP decides to oppose the government will it be defeated.

Second, if the government loses a vote of confidence in parliament, the likely consequence will be a fresh general election. As things stand, this could well produce a Labour government, with Jeremy Corbyn as prime minister. Corbyn is a committed left-wing socialist. That would terrify right-wing Conservative members of parliament (MPs) who might be tempted in other circumstances to rebel against their own party leadership. Moreover, in the past, Corbyn has had close links with leading members of Sinn Féin. He is the last person the DUP would want as prime minister. So, for the time being, the threat of a fresh general election should be enough to keep Conservative and DUP MPs in line.

Third, Conservative MPs may find it hard to do what many of them would like and replace May with a better, more voter-friendly party leader and prime minister. The party’s rules give the final decision on electing a new leader to grassroots party members. The task of MPs is to choose two names to put before the wider membership. Last summer, the two were May and a little-known but vocal pro-Brexit minister, Andrea Leadsom. May became prime minister not because she won the vote but because Leadsom withdrew her name at the last moment, following a much-criticized newspaper interview in which she said that as a mother, she was better qualified to lead the nation than the childless May.

Had Leadsom not given that interview and stayed in the race, she might well now be prime minister, because most grassroots Tories are strongly pro-Brexit and May had campaigned in the June 2016 referendum, albeit half-heartedly, for the UK to remain in the EU. Likewise, a contest to succeed May could very well be won by the more right-wing of the final two candidates; and many Conservative MPs are fearful of the consequences of the party moving toward a more hardline stance in the Brexit negotiations with the EU’s chief negotiator, Michel Barnier. If the next Tory leader is not to be right-wing, the likeliest victor is Boris Johnson, the foreign secretary. But he is anathema to many Tory MPs, not so much because of his ideology, but because they regard him as far too erratic and untrustworthy to be their leader.

May, then, is safe for the moment—provided, of course, that she wishes to stay on. She may not. She was battered by this month’s general election and has been widely attacked for her inept response to the June 14 fire in the Grenfell Tower apartment block in West London. The pressures on her are plainly enormous. It is possible that she will decide to step down. But, if she is determined to keep her job, she probably can, at least until after the summer.

What then? The three-part logic that supports her short-term survival will not change. However, the Brexit negotiations will impose huge strains on the Conservative Party. The talks may go badly wrong. Britain could well reach the position, perhaps next spring or summer, in which parliament must choose between an unpopular compromise and the UK crashing out of the EU without any deal at all. In this context, an unpopular compromise might consist of the EU offering Britain a free-trade agreement as long as the UK accepts EU product standards, enforced by the European Court of Justice, on goods traded with the EU—and agrees to pay an exit bill of, say, €30–40 billion ($34–45 billion).

Such a choice could tear the Conservatives apart. There are some MPs whose views on the EU are so fundamental to their reason for being in politics that they would vote according to their principles, regardless of the consequences for their party. And following this month’s election, there need only be ten or twenty MPs who are prepared to rock the Conservative boat for it to sink.

Six months ago, I saw little prospect of Labour returning to power before the mid-2020s. Now, I would not bet much money against Corbyn becoming prime minister by the middle of next year.

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