Section 51 of the Constitution of Australia grants legislative powers to the Australian (Commonwealth) Parliament only when subject to the constitution. When the six Australian colonies joined together in Federation in 1901, they became the original States and ceded some of their powers to the new Commonwealth Parliament. There are 39 subsections to section 51, each of which describes a "head of power" under which the Parliament has the power to make laws.
The Commonwealth legislative power is limited to that granted in the Constitution. Powers not included in section 51 are considered "residual powers", and remain the domain of the states, unless there is another grant of constitutional power (e.g. Section 52 and Section 90 prescribe additional powers). Matters covered in section 51 may be legislated on by the states, but the legislation will be ineffective if inconsistent with or in a field 'covered by' Commonwealth legislation (by virtue of s109 inconsistency provision).
Section 51 of the Constitution of Australia Wikipedia
The most important heads of section in terms of supporting contemporary Commonwealth legislation are:‘the interstate trade and commerce power’: s51(i) trade and commerce with other countries, and among the States:
‘the corporations power’: s51(xx) "foreign corporations, and trading or financial corporations formed within the limits of the Commonwealth"
‘the external affairs power’: s51(xxix) external Affairs:
'Taxation power': s51(ii) "taxation; but so as not to discriminate between States or parts of States": (Combined with s96 –see ‘tied grants’ below).
Federation was intended to address problems caused by having separate colonies on the one island continent. Section 51 therefore encompasses a group of ‘nationhood’ powers which reflect what powers a ‘nation’ was viewed as possessing. These include:Military defence: s51(vi) ( See Australian Communist Party v The Commonwealth (1951) for a landmark decision on the use of this power)
Census and Statistics: s51(xi)
Weights and measures: s51(xv)
Service and execution of court processes: s51(xxiv) and the recognition of judgements s51(xxv)
Naturalisation and aliens: s51(xix) and immigration s51(xxvii)
Powers for implementation of a uniform railway system (s51(xxxiii), s51(xxxiv), and s51(xxxii))
"the acquisition of property on just terms from any State or person for any purpose in respect of which the Parliament has power to make laws"; s51(xxxi)
"postal, telegraphic, telephonic, and other like services" s51(v).
The Constitution also grants powers over:Pensions (s51(xxiii) and s51(xxiiiA) (an amendment - see Social Services Referendum 1946).
Pacific relations 51(xxx)
The influx of criminals s51(xxviii)
‘Special laws’ for people of any race: s51(xxvi)
Marriage and divorce (s51xxi and s51xxii)
Copyright, patents, and trade marks s51(xviii)
Bills of exchange s51(xvi)
Banking (other than state banking) s51(xiii)
Insurance other than state insurance s51(xiv)
Conciliation and arbitration of industrial disputes: s51(xxxv) (NB: this power was used to support the conciliation and arbitration system, but future legislation is intended to be based on the broader corporations power)
Flexibility is allowed by:‘the referral power’: s51(xxxvii) allows State parliaments to refer matters to the Commonwealth
‘the incidental power’ s51(xxxix) allows the Commonwealth to act on matters ‘incidental’ to an enumerated head of power.
The High Court of Australia has the jurisdiction to interpret the constitution, an often controversial ability. Many of the court's interpretations have focused on section 51, from cases arising out of disputes between the states and the Commonwealth Parliament. It was noted in Pape v Commissioner of Taxation  that taxation power under s51(ii) is not "unlimited" and must be employed so as not to discriminate between States or parts of States.
All heads of power in section 51 have an implied incidental area (Lindfield v Marrickville). The incidental area arises when the law operates on persons, Acts, or things outside the actual subject matter of the head of power. Valid laws in the incidental area will have an indirect, but sufficient connection to the head of power. Different judicial tests have arisen to test if the connection is sufficient. The dominant test is if the law in question is a reasonable and appropriate means of furthering an object or purpose in the power (R v Burgess). Other tests are the ‘reasonably necessary’ test or ‘reasonable fulfillment of the purpose’. Justice Mason preferred a 'proportionality' test that took into account the adverse effects of incidental laws.
Section 51 appears to limit the areas of federal involvement. However, under section 96 of the Australian Constitution the Commonwealth Parliament has the power to grant money to any State, "on such terms and conditions as the Parliament thinks fit." In effect, the Commonwealth can make grants subject to States implementing particular policies in their fields of legislative responsibility. Such grants, known as tied grants (since they are tied to a particular purpose), have been used to give the federal parliament influence over state policy matters such as public hospitals and schools.
Section 96 does not compel a state to accept a grant, so constitutionally a state may refuse a grant and not implement any policy conditions. However, since a uniform federal system of income tax was introduced in 1942 (under s51(ii)) a vertical fiscal imbalance has arisen and the Commonwealth Parliament has had a vastly larger budget. It also has control over state borrowings (under subsection iv). This has meant that the Parliament's powers have effectively been extended beyond the constraints of section 51 and other explicit grants of legislative power (e.g. section 52 and section 90).