Prime ministers are appointed based on their ability to command confidence in the House of Commons. If an election produces a clear majority for one party, then the leader of that party becomes prime minister. If it is the incumbent prime minister, then they continue in office. If it is another party, then the incumbent formally resigns the morning after the election and they are replaced.
If no party wins a clear majority, then there may be a process of negotiation before it becomes clear who is likely to be prime minister. An incumbent prime minister is entitled to remain in office and test whether they can command confidence, or they may resign if it becomes obvious that they will not be able to do so.
However, it is vital that a prime minister is in place and there is an expectation they will not resign until it is clear who can take over.
The incumbent prime minister informs Buckingham Palace that they will be resigning. There is then a well-rehearsed sequence of events in which the outgoing prime minister travels to see the King and formally tenders his or her resignation. They have a short audience with the King.
After the outgoing prime minister has left, the incoming prime minister arrives and is formally asked by the King to form a government. This audience is known as ‘kissing hands’, though they are more likely to shake hands. After their appointment, the new prime minister heads straight to 10 Downing Street.
The Monarch’s role in appointing a prime minister is one of the remaining prerogative powers. These are residual powers remaining with the Sovereign that have not been placed elsewhere. The majority of those powers are exercised on his behalf by ministers, but the power to appoint prime ministers remains with the King.
If the government hold a majority, it is for the party or parties in government to identify the successor. It is usual practice for the prime minister to be the leader of the party. Changes of prime minister outside a general election therefore usually take place when a prime minister has resigned as leader of the party, or been forced out through a confidence vote or leadership challenge. In 2022, after Boris Johnson announced his intention to step down, the Conservative party held a leadership election which saw Liz Truss become Conservative leader on 5 September and prime minister on 6 September. Johnson remained prime minister throughout the leadership contest.
If a prime minister resigns and the party in government does not have a majority, it becomes more complicated. If a clear alternative is likely to be able to command confidence, then this only needs to be made clear to the Palace. This could be through some parliamentary mechanism, but it can also be through coalition or confidence and supply agreements between parties or letters of support.
There is a strong constitutional convention that the Sovereign should be kept out of politics.
If there is no clear majority, or if negotiations over government formation have not produced a clear answer as to who can command confidence, then it is expected that political parties will establish who is best placed and ensure that the King is not dragged into any disputes. According to the Cabinet Manual, "the Sovereign should not be drawn into party politics, and if there is doubt it is the responsibility of those involved in the political process, and in particular the parties represented in parliament, to seek to determine and communicate clearly to the Sovereign who is best placed to be able to command the confidence of the House of Commons".
The question of who can command confidence only arises if a party has not won a majority or has lost it during the lifetime of a parliament.
The Cabinet Manual says that "an incumbent government is entitled to wait until a new parliament has met to see if it can command the confidence of the House of Commons, but is expected to resign if it becomes clear that it is unlikely to be able to command that confidence and there is a clear alternative". In 1924, Stanley Baldwin resigned after being defeated on a King’s Speech
At other times, prime ministers will resign if it is self-evident that they will not be able to command confidence. In February 1974, Edward Heath resigned after a weekend attempting to negotiate an agreement with the Liberal Party. He was replaced by Harold Wilson, who led a minority Labour government. In May 2010, Gordon Brown resigned five days after the election when it became clear that negotiations with the Liberal Democrats would not produce an agreement with Labour and that the Conservatives were more likely to be able to form a coalition.
It is the role of the King's private secretary, the prime minister’s principal private secretary and the cabinet secretary to maintain communication between Buckingham Palace and politicians in trying to establish who can command confidence. They are known colloquially as the ‘golden triangle’.
The Cabinet Manual emphasises that ensuring the King is able to appoint a successor is a role that "falls especially on the incumbent Prime Minister", who may also be asked to advise him on who is best placed to be appointed. It is advice with a lower-case a.
However, 1949 civil service papers say that the monarch "has the absolute right to consult anyone he pleases" and that in a "complicated political situation" the monarch can consult more widely.
There were at least two occasions in the reign of Queen Elizabeth II where she had to make a decision that caused controversy.
In July 1953, Prime Minister Winston Churchill suffered a stroke at a time when his expected successor, Anthony Eden, was undergoing an operation. Buckingham Palace had to consider options for a caretaker prime minister if Churchill died. In 1963, she invited Alec Douglas-Home to see whether he could form a government when the outgoing prime minister, Harold Macmillan, advised her to do so. This was against the wishes of other senior Conservatives who expected to be in the running and eventually led to the introduction of formal rules for how Conservative leaders are chosen.