No voter in the United Kingdom has ever cast a ballot for a Prime Minister. There is no separate election for the post, and the name on a ballot paper is always that of a candidate for a single constituency. The office goes to whoever can command the confidence of the House of Commons, and the monarch appoints that person.
What is the actual test?
Commanding the confidence of the Commons, which means being able to win a confidence vote and get a budget through. Nothing else is required. There is no minimum vote share, no requirement to have won the most seats, and no legal qualification beyond being able to hold the position in practice.
Every Prime Minister since 1902 has sat in the Commons, though that is convention rather than law. A Prime Minister in the Lords would face the practical problem of being unable to answer to the elected chamber, which is why the convention has hardened.
What happens after a general election?
If a party wins an overall majority, the process is quick. The losing Prime Minister resigns, usually the morning after polling day, and the winner is invited to the Palace and asked to form a government. Both journeys happen within a few hours.
The incumbent stays in office until they resign, which matters. There is never a moment without a Prime Minister, and the sitting occupant is entitled to remain and test the confidence of the new House even if their party has lost seats.
What happens in a hung parliament?
The incumbent gets the first opportunity to form a government, whether or not their party won the most seats. This surprises people, and it is set out plainly in the Cabinet Manual: the Prime Minister remains in office and may seek to command confidence, resigning only if it becomes clear they cannot.
Negotiations follow, and the outcome may be a coalition with ministerial posts for a smaller party, a confidence and supply agreement, or a minority government proceeding vote by vote. In 2010 the incumbent resigned after five days of talks; in 2017 the incumbent stayed and negotiated support.
What about mid term changes?
This is the route by which a substantial number of Prime Ministers have arrived, and it involves no general election at all. When a governing party changes its leader, the new leader becomes Prime Minister, because they now command the same Commons majority the party already held.
The internal contest is governed entirely by party rules, which differ between parties and change frequently. Typically members of Parliament from the party narrow the field and the wider membership chooses between the final candidates, though contests have been settled without a membership ballot when only one candidate remained.
What is kissing hands?
The formal audience at which the monarch invites the incoming Prime Minister to form a government. The name comes from the historic gesture, which is no longer performed literally. There is no oath, no ceremony of office and no public swearing in.
The appointment takes effect immediately. The new Prime Minister leaves the Palace, travels to Downing Street, makes a statement outside the door and begins appointing a cabinet the same afternoon. The whole transfer of executive power in the United Kingdom takes a matter of hours.
Does the monarch have any real choice?
In normal circumstances, none. The monarch appoints whoever can command confidence, and where that is obvious the decision is automatic. The constitutional purpose of the role is to ensure there is always a government, not to select one.
The theoretical difficulty arises only if no outcome is clear and the parties cannot resolve it, which has not happened in modern times. Convention holds that the palace should be kept out of political negotiation, and the practical effect is that party leaders are expected to reach an answer among themselves before anyone approaches the monarch.
One consequence of all this is worth stating plainly, because it is a frequent source of complaint. A Prime Minister who takes office mid term without a general election has exactly the same authority as one who has just won an election, because the constitutional test is confidence in the Commons and nothing else. Whether that is politically sustainable is a separate question, and it is one several recent occupants have had to answer.