When you normally have sex and orgasm, theres a release of neuro transmitters and chemicals throughout the brain and spinal cord. Norepinephrine rushes to the area and releases the orgasm, after the body is pleasured enough by stimulating serotonin. The exact same happened to you, but you didn't have to work for it.