To understand why Australia has states and territories, you would need to look at the process of Federation in 1901.
Before 1901, Australia consisted of six British colonies which were partly self-governing, but under the law-making power of the British Parliament. In the 1880s and 1890s, it was suggested that the colonies might be stronger and more efficient if they worked together. Several conventions were held to draft the Australian Constitution. In 1899, the draft was approved by a vote of the people in referendums. In 1900, it was agreed to by the British Parliament. On 1 January 1901, the Australian colonies united to become a nation. This is known as federation and resulted in the creation of a federal Parliament, with the colonies becoming Australia's six states. Through federation, the states transferred some of their law-making power to the federal Parliament.