A test that doctors sometimes do to check up on spinal reflexes. If things go as planned, the doctor will tap the patient's knee with a rubber hammer, and the patient's foot will go flying up. (That's why it's a good idea for the doctor to stand off to the side.) Humans have developed this reflex over time to ensure that the legs will automatically extend to support the rest of the body while walking or standing upright, even when there is strain -- usually due to gravity -- on the knees.

So, here's how it works:
When the knee is tapped -- or, in the real world, pulled down by gravity -- a muscle in the knee stretches. This signals the sensory cells in the muscle to send a message to the sensory neurons, which consequently send the message down to the spinal cord. From there, the message does a u-turn. At the spinal cord, it gets passed from the sensory neurons to the motor neurons, which send a message back down the line to the same muscle that was originally stretched. The message causes the knee muscle to contract, which sends everything below the knee flying upward and causes the knee-jerk reaction. The reaction can also be influenced by processes in the brain; for instance, it is possible to will the reaction not to occur if you know when to expect it.

This information was taken from Hilgard's Introduction to Psychology (thirteenth edition); written by Rita L. Atkinson, Richard C. Atkinson, Edward E. Smith, Daryl J. Bem, and Susan Nolen-Hoeksema; Harcourt College Publishers; New York; 2000.