It's worth noting that the heir apparent PM is a supporter of the Online Safety Act, which hands over regulation of any Internet service 'accessible to anyone in the UK' allowing any two users to communicate to the UK's broadcasting regulatory board[0], which demands reports about what kind of users the service, their ages, and a plethora of other information which seems to create regulatory capture: in addition to mandatory age verification. It does this by creating a gray area of speech defined as 'harmful content' which is not in itself illegal but its presence is sufficient to levy fines and ban the Internet service from everyone's in the UK if the regulations are not complied with.
Under the UK system, the PM is both pretty much all powerful AND chosen by the party. That means about 100k people will be picking who will be elected dictator for about the next 2 years. It's pretty crazy IMHO.
The PM is essentially a monarch. But like all British monarchs they rule with the consent of their Barons - these days the MPs in their party that will give them a majority in the House of Commons.
The PM has a great deal of power, but their grip on power is precarious as we saw with Boris. They are really just first amongst equals. If they don't deliver they are out and another of the elected MPs will take charge.
Really it is the MPs that select their leader. However in the Tory case if they can't reach a consensus they refer it to their party for a tie breaker.
Remember the UK has a Parliamentary system, not a presidential system. There is no separation of powers in the UK. Everybody that matters sits in the House of Commons as an elected Member of Parliament, and the government is drawn from that set of people - with a permanent civil service providing the supporting functions.
It's quite a difficult problem to solve, really. The easy answer is for the existing PM to continue until the next election (which is the US model) but if they've lost the support of Parliament (which Johnson basically had) then they're not able to govern.
Given that you need a new PM, how do you pick one? There are four obvious choices:
* The Queen picks one (herself). This hasn't been done since the early 19th Century for obvious reasons.
* Parliament (or, more realistically, the Parliamentary Conservative Party or some subset of it) picks one. The difficulty is that well over half of the MPs are elected purely because of the party label against their name and not because of any intrinsic quality. And they're also very different people from the public as a whole. Is a choice of that ~200 people a good or democratic one? The 'classic' means of the Conservative party selecting a new PM in office is for a name to 'emerge' from private discussions among senior members of the party and be sent to the Queen...
* The political party as a whole picks one. This gives a broader base for discussion and support, limits the creation of closed cliques within Parliament, and reflects that the PM is, in the first instance, the leader of the party concerned and PM only because that party has a majority in the Commons. On the other hand, the people who are members of political parties are also very different people than the public as a whole, and on at least some issues tend to have less centrist views. And the choice of party members prior to an election they need to win may be expected to be more moderate than a 'mid-term' replacement where their nominee gets the powers of office without needing to appeal to the country more broadly.
* The public chooses one through a new general election. This makes the most democratic sense, but has a serious downside: there are strong game theoretic reasons for a party not to remove a PM who has lost the ability to govern if the consequence is an election that polls say that party is likely to lose. If this had been the rule than there is basically no chance that Johnson would have gone, which (given the reasons for his departure) would have been seriously problematic.
So, four bad options. Pick which one you dislike least.
Personally, I think the new Tory leader should have been picked directly by the whole party, i.e. with all 8 original hopefuls on the ballot. Party members who vote then put down their preferred 1st, 2nd, and third options, which are then used to prevent a tie breaker or lack of majority vote.
What we had, was still an elite few whittling down the options to a preferred two, with zero input from the party as a whole.
[0] https://www.techdirt.com/2022/08/02/uks-likely-next-prime-mi...