A person can only be the Prime Minister or a minister if they are a member of parliament. So, if the Prime Minister or a minister lost their seat in an election they would no longer be a member of parliament. The Prime Minister is the leader of the government and is chosen by a vote of the members of the government.