In human males, the scrotum holds the testicles in a pouch outside the body, which I am told, is because sperm production works better at temperatures slightly colder than core body temperature.

The scrotum can be partially retracted into the body, by way of the cremaster muscle. The cremasteric reflex, which causes the muscle to contract and accordingly shift the scrotum, can be elicited by gently stroking the inner thigh of the subject.