The alarm inside the battery-powered smoke detector will eventually run out of power and cease sounding, unlike that of a hard-wired detector. If no one is home and you live in an apartment with thick walls, the neighbors may not hear the alarm during the amount of time that it is sounding.
Hard-wired smoke detectors can be interconnected -- which is to say wired from one to another -- so that they share the signal being received by the sensor on one of the detectors. Unlike a battery-powered smoke detector, this enables the hard-wired smoke detector that is sounding an alarm to activate the alarms on all of the other detectors it is connected to.
Hard-wired smoke detectors feature a battery backup that functions in the case of a power failure in the home's electric line. No secondary or additional backup for a battery-operated smoke detector exists if its battery should go dead.
The hard-wired smoke detector requires a disassembly from the wall or ceiling and disconnection of wiring if there is a problem, as opposed to a battery-powered detector which can be snapped open to remove the battery and replace it with a new one. This feature makes maintenance on a battery-powered smoke detector easier than if it is hard wired to the electric line.