The original, clinical definition of a stim is "A full body movement that relieves autistic anxieties." FULL BODY would include rocking, swaying, hand flapping, toe walking, etc.
Some have expanded their definition to include small, fidgety repetitive habits, like nail biting, finger drumming, hair twisting, and so on, but these behaviors, while they may be borne out of anxiety, do not do anything to release or relieve autistic anxiety. They belong more in the category of obsessive tics or twitches.
Autistic anxiety comes from constant sensory hyperstimulation as a result of too many sensory neuro receptors in the brain. The brain is constantly overstimulated by the pressure of processing too much sensory input, and the stim motion, like rocking a baby to sleep, is to soothe and comfort.