
There is growing speculation that opposition MPs will table a vote of no confidence in Boris Johnson's government in September in an effort to stop a no-deal Brexit on 31 October.
What is a no confidence vote?
It is a chance for MPs to hold a vote on whether they want the government to continue - and it has the power to trigger a general election.
Any MP can propose a motion of no confidence, but that doesn't mean it would be debated.
However, if the leader of the opposition - currently Labour leader Jeremy Corbyn - introduces the motion, convention means the government will provide time for a debate to take place.
The wording of a no-confidence motion is: "That this House has no confidence in Her Majesty's Government."
The motion needs a simple majority to pass - so it only requires one more MP to vote in favour than the number voting against.
What happens if the government loses?
Losing a no-confidence vote starts a critical 14-day period, after which a general election could be triggered.
To prevent an automatic general election taking place, the existing government - or an alternative one formed during that period - must persuade MPs to pass a vote of confidence.
The wording of the confidence motion has to be: "That this House has confidence in Her Majesty's Government."
At the end of the 14 days, assuming such a motion hasn't passed, the prime minister advises the Queen when the general election will take place.
Parliament is dissolved 25 working days before the general election date.
There are no firm rules about who, if anyone, should get the chance to form an alternative government during the 14-day period. The leader of the opposition is clearly a likely candidate, but that is not an inevitable outcome.
The Cabinet Manual - a document which sets out the main rules covering the working of government - suggests that the principles applied should be similar to those after an election in which no one party wins a majority.
That means that the old prime minister should only resign if and when it's clear that somebody is more likely to have the support of MPs.
So it's possible that the existing prime minister would stay in place, or that more than one leader would get a chance.
Could the prime minister refuse to resign?
If an alternative government is ready to take over, the existing prime minister would be expected to resign. However, there is nothing clearly stated in law that says the prime minister must do so.
But failure to resign in such circumstances would risk bringing the Queen into the heart of the Brexit dispute. Ultimately, it is the Queen that appoints prime ministers and in theory the monarch can dismiss a prime minister who behaves unconstitutionally.
But such a situation is very unlikely, according to Maddy Thimont-Jack, at the Institute for Government think tank.
"If there is clearly someone else who could form a majority or has majority support in Parliament, the political pressure would be such that the prime minister would be obliged to resign. It's an extremely important and established political convention," she says.
How could the prime minister be defeated?
Boris Johnson has a wafer-thin majority in Parliament. The loss of the Brecon by-election to the Lib Dems has reduced it to one.
Since the 2017 general election the Tories have been reliant on the 10 DUP MPs in the House of Commons. And their majority has become narrower over time after a series of defections.
So, if some Tories are prepared to vote against them in a no-confidence vote the new prime minister could be in office for only a brief period.
Previous no confidence votes
Before the law was changed in 2011 to say elections would be held every five years, the rules governing votes of no confidence were different.
Prime ministers had the power to call general elections whenever they wanted. That meant they could turn votes on particular bits of legislation into "confidence votes".
In other words they would threaten to call an election unless MPs backed a new law.
However, this is no longer an option. Elections are only triggered by no-confidence votes with precisely the right wording.
However, the fundamental principle remains the same. Governments can only continue if they have the confidence of the House of Commons.
There's only been one occasion since World War Two when the government lost a no-confidence vote.
That was in 1979, when the Labour minority government fell and was replaced by Margaret Thatcher's Conservatives at the general election which followed.