An IMS measures how fast a given ion moves in a uniform electric field through a given atmosphere.
As Autolycus detected fumes from the submarine, rather than the hull, it could detect the passage of a submarine for some time after it had passed.