Capsaicin is used as a pain reliever, and it can be applied to the skin as a patch or a cream. It has been used to treat the pain of arthritis, shingles, and sore muscles. When capsaicin is applied to your skin, a steady stream of neurotransmitters is sent to the brain, stimulating pain signals in the body. Once these neurotransmitters are depleted, you no longer experience pain. You are exchanging short-lived intense pain for constant, low-level pain that your body gets used to. Once the nerve cells become depleted of neurotransmitters, they lose their ability to sense pain. But after you remove the capsaicin from your skin, the pain may return, because the neurotransmitters build up again.
It is generally accepted that peppers contain capsaicin as a defense against predators. It seems to play a role against certain types of fungus that are partial to hot peppers.