It uses long-wavelength radio waves, so it's more analogous to ultrasound, so yes it is "like" X-rays in that it penetrates clothing, but uses much safer radiation to do so. and the way it "detects" the explosive is to allow you to "see" in the computer generated image that the passenger has a strange item taped to his groin.
Actual detection of the explosive itself is done by chemical instruments that can identify very tiny amounts of specific chemicals. You step into a booth that pulls a volume of air around you, and said air is fed to the instrument. If the person has on their body (or has handled) an explosive compound, at least a few molecules WILL be in that air, and will be detected.
Both technologies should be used, but they ain't cheap.