Both hardwired and battery smoke alarms detect smoke the same way, the difference is in power source and, often, in what's actually required for your property.
Hardwired alarms connect directly to your home's electrical wiring, with a battery backup in case of a power outage. They're generally required in Victorian homes built after 1 August 1997 and can be interconnected so every alarm sounds together.
Battery-only alarms are simpler to install and don't require an electrician, but they rely entirely on the battery and typically can't be interconnected with other alarms.
Hardwired, interconnected alarms are the stronger option for most homes, particularly larger or multi-level properties, since they don't depend solely on a battery and alert the whole home at once.
If your home currently has older battery-only alarms, upgrading to hardwired interconnected alarms is a straightforward job for a licensed electrician, and a common one to pair with other electrical work.