The Prime Minister is the person who nominally controls enough votes to maintain a Commons majority of 1, and is appointed PM by the Queen on that basis. This does not necessarily mean the leader of the party with the most seats, and does not preclude a PM running a minority Government.
And as for your other point about 'voting out an elected Parliament', research Fixed Term Parliaments, it's virtually impossible to get rid before the 5 year term, ( unless the PM has a suicide wish like Tessy May last time around ).