The technology works on the basis that all people and objects emit low levels of electromagnetic radiation. Terahertz rays lie somewhere between infrared and microwaves on the electromagnetic spectrum and travel through clouds and walls.
Depending on the material, the signature of the wave is different, so that explosives can be distinguished from a block of clay and cocaine is different from a bag of flour