The Prime Minister is the person who is supported by the House of Commons. Which generally means a majority of the MPs in the House of Commons. Which generally means either a single party or a coalition of parties who have more than 50% of the MPs. Changing PM can happen because a majority of MPs support a different person for Prime Minister. This can happen because the leader of a party (or coalition) resigns, or is forced out, and is replaced by a new one. Or because a general election is called and the allegiance of The House changes because its makeup has changed.
A general election is triggered in one of three ways*:
1) The House of Commons holds a vote of No Confidence, and doesn't hold a vote of Confidence within two weeks.
2) A 2/3 majority resolves to hold an election.
3) Repealing the Fixed-Term Parliaments act.
(1)Would require the Conservatives to No-Confidence themselves out of office. Not impossible, but looks pretty silly.
(2)Providing Labour and the Conservatives both agree that an election would be a good idea, this looks like the easiest route.
(3)Would work easily, but option (2) is probably easier, as it doesn't require a new law to be passed (and the faff it would cause).
You might ask, why does the Fixed-Term Parliaments act exist if it's easy for the current government to override it? And the answer is that if there is a split House of Commons, involving a coalition, then one member of the coalition can't just declare an election, it requires a majority or a supermajority to do so.
*Because of the Fixed Term Parliaments Act of 2011.
Original post on Dreamwidth - there are comments there.