Testicular torsion occurs when the testicle twists around the spermatic cord, the structure that supplies blood to the testis. This twist cuts off blood flow, causing severe pain and rapid damage.