Pain is a warning signal from your brain that's meant to protect you from further harm. Pain can be simple, such as when it prompts you to pull your hand away from a hot stove element to protect your skin from damage. Pain can also be complex, such as pain that persists for years following brain or nerve damage.
TENS machines provide electrical nerve stimulation to reduce pain. TENS stands for "Transcutaneous" (through the skin) Electrical Nerve Stimulation, since it delivers electrical energy to the nerves through electrodes placed on the skin. Electrical nerve stimulation can treat acute pain (e.g. after knee surgery) or chronic pain (e.g. persistent low back pain).
Almost everyone will experience some type of physical pain - pain is actually an important body function. When it's working properly, pain protects us from hurting ourselves. For example, feeling pain when touching a hot element on a stove allows us to quickly pull our hand away and prevent a burn.