"How does the leading party decide the PM, and how?"

The Prime Minister is a member of the House of Representatives who leads the parliamentary party, or coalition of parties, with the support of the majority of members in the House. Each political party has its own arrangements for electing its leader. In the case of the current government – the Liberal Party and The Nationals Coalition – the Prime Minister is the leader of the Liberal Party of Australia and is chosen in a vote by their parliamentary party. In the case of the current opposition – the Australian Labor Party (ALP) – the leader is chosen by a combined vote of their parliamentary party and the ordinary members of the party. The votes of the ALP members of parliament count for 50 per cent in the ballot and the votes of the ordinary party members count towards the other 50 per cent.

diagram to help explain How does the leading party decide the PM, and how?