Before federation, the states were British colonies. Each had been given the power to make laws for that colony by the British Parliament. When Australia became a nation on 1 January 1901, the colonies—now states—transferred some of their law-making powers to the new Australian Parliament.
Areas not listed in Section 51 are the responsibility of state governments. These state issues include hospitals, police and roads.
Sometimes both the Australian Parliament and the states have the power to make laws about the same issue. Section 109 of the Constitution states that a federal law may override a state law if there is a conflict between the two. Using Section 122 of the Constitution, the Australian Parliament may override a territory law at any time.
You can find lots of detail about the three levels of law-making in this fact sheet and you might like to research federation to learn more about the governing of Australia before 1901.