Stimming is almost always a symptom of autism, but it's important to note that stimming is also a part of most people's behavior patterns. If you've ever tapped your pencil, bitten your nails, twirled your hair, or paced, you've engaged in stimming.
The biggest differences between autistic and typical stimming are the choice of stim and the quantity of stim. While it's at least moderately acceptable to bite one's nails, for example, it's considered unacceptable to wander around flapping one's hands. There's really no good reason why flapping should be less acceptable than nail biting (it's certainly more hygienic!). But in our world, the hand flappers receive negative attention while the nail biters are tolerated.
Like anyone else, people with autism stim to help themselves to manage anxiety, fear, anger, and other negative emotions. Like many people, people with autism may stim to help themselves handle overwhelming sensory input (too much noise, light, heat, etc).
Unlike most people, though, individuals with autism may also self-stimulate constantly, and stimming may stand between them and their ability to interact with others, take part in ordinary activities, or even be included in typical classrooms. A child who regularly needs to pace the floor or slap himself in the head is certain to be a distraction for typical students.
It's not completely clear why stimming almost always goes with autism, though it's often called a tool for "self regulation." As such, it may well be an outgrowth of the sensory processing dysfunction that often goes along with autism. At times, stimming can be a useful accommodation, making it possible for the autistic person to manage challenging situations. When it becomes a distraction or causes physical harm to self or others, though, it must be modified.
Lessening or modifying stims can be tricky, but several approaches may be helpful. Applied Behavior Analysis (ABA) may help individuals to eliminate or modify some of their stimming. Occupational therapy is another useful tool.
In some cases, stimming can be reduced with medications that address underlying issues of anxiety. Finally, some people with autism can learn through practice and coaching to either change their stims (squeeze a stress ball rather than flap, for example) or engage in excessive stimming only in the privacy of their own homes.
S. Goldman et al. "Motor stereotypies in children with autism and other developmental disorders." Dev Med Child Neurol. 2009 Jan;51(1):30-8.
RL Koegel. "Extended reductions in stereotypic behavior of students with autism through a self-management treatment package." J Appl Behav Anal. 1990 Spring;23(1):119-27.
KS Lam et al. "Evidence for three subtypes of repetitive behavior in autism that differ in familiality and association with other symptoms." J Child Psychol Psychiatry. 2008 Nov;49(11):1193-200.