The first device consisted of an engine (taken out of a children’s toy) with contact breaker. The engine broke the contacts, which were connected to the transformer with battery (like magneto in a tractor). The transformer was connected to the electrodes. Impulses, which were generated by contact break (self-induction) were close to the nerve impulses. When the electrodes were placed on the skin in the area of pain sensations you could achieve pain-relief effect. This device was the ancestor of all TENS devices (devices for pain-relief).
With time, the toy engine was replaced with generator, the contacts were replaced with electronic switch, and the transformer was left as it was. This is how a TENS was born. And all TENS devices are still made on the same principle.