An allusion to caged canaries (birds) that miners would carry down into the mine tunnels with them. If dangerous gases such as carbon monoxide collected in the mine, the gases would kill the canary before killing the miners, thus providing a warning to exit the tunnels immediately.
Canaries, like other birds, were good early detectors of carbon monoxide because they’re vulnerable to airborne poisons because they need such immense quantities of oxygen to enable them to fly and fly to heights that would make people altitude sick.
Bird anatomy allows them to get a dose of oxygen when they inhale and another when they exhale, by holding air in extra sacs.
Relative to mice or other easily transportable animals that could have been carried in by the miners, they get a double dose of air and any poisons the air might contain and, therefore, miners would get an earlier warning about build up of toxic gases.