endorphins
When you exercise or being spanked, your body releases chemicals called endorphins, which are produced by the central nervous system and the pituitary gland. These endorphins interact with the receptors in your brain that reduce your perception of pain.