Original: This is done by the contracting and relaxing of the cremaster muscle in the abdomen and the dartos fascia (muscular tissue under the skin) in the scrotum.
Simplified: This is done by muscles contracting or relaxing.