If I had to guess, the equipment for detecting the chemicals has to be very sensitive so that it detects the faintest traces of it (to err on the side of caution). False positives are a hassle, but a false negative could have disastrous consequences.
Very sensitive equipment has to have a ton of gain to detect small signal levels. With a ton of gain comes a lot of noise. Separating signal from noise is a delicate business.
Then there is the problem that chemical compounds occur in vast combinations. The equipment has to identify some known explosives, from among billions of harmless molecules. It has to do this without actually reconstructing the molecular shape, which would require something like X-ray crystallography. It has to also work without having a sizeable sample of the substance which would be needed for Infra-Red or mass spectroscopy; just a whiff from a suitcase.
It's pretty amazing that this stuff works at all, really. It's amazing what a human, or for that matter, canine nose is capable of, too.