The cremasteric reflex is a contraction of the cremaster muscle that causes the testicles to retract. This reflex can be triggered by stroking or poking the inner thigh. Reflex will occur on the side of the body that corresponds to the stimulated thigh (e.g. If you stroke the left thigh, the left testicle will retract).
More About Cremasteric Reflex
The cremaster muscle serves to draw the testicles towards the body (for warmth, protection, etc). The cremasteric reflex is quite important to testicular health and function. When the cremasteric reflex does not occur, as may happen in the case of an injury like testicular torsion, it can indicate a medical issue of some sort that should be further examined.