Kingdom: Plantae
(Unranked): Angiosperms
(Unranked): Monocots
(Unranked): Commelinids
Order: Poales
Family: Poaceae
Genus: Spinifex
Species: Spinifex sericeus 
Synonym:  Spinifex hirsutus
Common names: Kowhangatara, Beach Spinifex, Spinifex, Coastal Spinifex, Hairy spinifex

Spinifex sericeus is the most important native sand-binding grass in New Zealand. Spinifex favours dunes immediately behind the beach. It can tolerate high winds, salt spray and shifting sands.
The male and female flowers are produced on separate plants and the distinctive spiky heads are produced by the female plant.
Once autumn nears the spiky seed heads of Spinifex grass, powered by wind, roll along the beach until it gets trapped. Then the fine sand submerges the seed balls which then releases its seeds to restart the cycle of growth and dispersion.  If the heads are trapped where they become saturated by an incoming tide they break up and these bits are then carried to other suitable areas to germinate.
The seeds grow into perennial grass that is greyish-green of colour with a hairy surface. Its rhizomes grow into multiple metres long runners with buds developing into new male and female plants that bloom during spring and early summer.
This indigenous sand binding grass is an important place in giving some stability to foreshore dunes on windswept beaches and prevents dunes from moving inland. Dunes naturally take the role of shore protectors in both directions, from the incoming surf of the sea and filtering the water coming from wetlands that are close to the shore. 
The shorebirds like Caspian terns, the threatened dotterels, oystercatchers, gulls, insects and reptiles these dunes are their home and breeding ground.

[1]

[2]

[3]

The tumbleweed like female flowerheads before being released.
[4]  

The spiky female flowerhead.

The tumbleweed like female flower heads can be up to 30cm wide.
[5]   

Spinifex sericeus with male flowerheads. Male and female flowerheads are on separate plants.
[6]

Spinifex sericeus male flowerhead
[7]

Male flowers.
[8]

Spinifex sericeus in very dry conditions.
 

Thanks to Wikipedia for text and information: https://creativecommons.org/licenses/by-sa/3.0/