Australia uses a system of parliamentary government, which means that the government is drawn from the legislature. The Prime Minister is a member of the House of Representatives or Senate, and they must also be a member of the political party that forms government.
The House of Representatives is elected directly by the people, using a system of proportional representation. The Senate is also elected by the people, but uses a different electoral system called preferential voting.
The party that wins the most seats in the House of Representatives is able to form government, and the leader of that party becomes the Prime Minister. The Prime Minister is then appointed by the Governor-General, who is the representative of the Queen of Australia in Australia.