If the theft-deterrent system detects an inappropriate entry into the vehicle, which could result in the vehicle or its contents being stolen, the alarm alerts the surrounding area of an abnormality by sounding the horn and flashing the hazard warning lights.
The system will not function unless it's properly armed. So when you leave the vehicle, follow the arming procedure correctly.
Operation
OperationMazda 6 Owners Manual: Location index
INTAKE-AIR SYSTEM
FUEL SYSTEM
Engine Room Side
Fuel tank side
EMISSION SYSTEM
Engine room side
CONTROL SYSTEM
...
Mazda 6 Owners Manual: Contact Authorized Mazda Dealer and Have Vehicle Inspected
If any of the following warning lights or the indicator light turns on/flashes,
the system may have a malfunction. Contact an Authorized Mazda Dealer to have your
vehicle inspected.
...