Gordon Brown becomes Prime Minister tomorrow (Wednesday). We, the people do not elect the Prime Minister. The Labour party in this case elect their party leader and if as in this case Labour win the election, then the party leader becomes Prime Minister. The people of Sedgefield were the only people who voted for Tony Blair.
Why don't the Prime Ministers stay elected?
Many reasons. McMillan was wrongly diagnosed with inoperable cancer, resigned, then lived for many years. Wilson thought MI5 were plotting against him and planned to overthrow the government, they weren't and didn't. Thatcher was dumped because she had become an electoral liability, likewise Blair.