Testicles lift and descend in response to the contraction and relaxation of the cremaster muscle. Testicles rest gently inside this thin, pouch-shaped muscle, which draws them toward or away from the body as a way of regulating their temperature. The Mayo Clinic lists several factors, apart from temperature, that can trigger the retraction of the testicles. These include stimulation of the genitofemoral nerve and extreme emotions such as anxiety.
Sexual arousal is another condition that can affect the tension in the cremaster muscle. At high states of arousal, the muscle often contracts and brings the testicles close to the body. When this happens, the skin of the scrotum becomes wrinkled and the testicles' temperature, which is usually a degree or two cooler than the body's core temperature, rises. According to HowStuffWorks, these movements are perfectly normal and are part of the male body's system for maintaining the optimal temperature for the formation of sperm.
Pain experienced during retraction, or at any other time, is potentially a sign of a serious medical problem. The National Institutes of Health considers acute pain in one testicle to be a medical emergency. If pain is present, or if the testicles fail to return to their normal state after retraction, it is important to seek medical assistance as soon as possible.