This is an elegant use of the natural behavior of bees. Bees use odors from flowers, water, and honey to find food and the gaseous pheromones from their hive navigate. It is not a huge leap to expect they could detect other chemical odors and be trained using food rewards to find explosives.
You can see this exact behavior in the picture. Some of the bees are sending the scent of home into the air by using their wings to send pheromones into the air.
You know the coolest part, bees naturally train other bees to find food using the waggle dance and circle dance to communicate the location and concentration of food sources.
Here's a brief quote from the BUZZ:
Using bees to detect land mines has its roots in decades-long research at the University of Montana , conducted by research professor Dr. Jerry J. Bromenshenk. Dr. Bromenshenk and his team have found that bees are expert sample-takers. They collect everything: air, water, vegetation, and chemicals in gaseous, liquid and particulate forms. A single colony can generate up to hundreds of thousands of flights every day, each bee returning to the hive with his collection.
More recently, Dr. Bromenshenk and his team began focusing on “odors of interest” under a DARPA [DoD researchers] contract. The team was able to document that the bees’ acute sense of smell enables them to function as fine-tuned, highly accurate vapor detectors for chemicals that are present in explosives, bombs,and landmines. Under certain conditions they can detect concentrations at approximately 30 parts per trillion, with the potential to reach an even lower threshold.