A stim is basically a regularly repeated tic or habit that may change in frequency (how often it happens) due to stress, fatigue, overstimulation, or even boredom. Tourette's syndrome is a good example of a condition dominated by tics, but these tics are uncontrollable. Stims can be somewhat controlled but they do happen regularly. Mine include picking my scalp, sometimes my nose, picking my ears, picking my teeth with my tongue or fingernail, occasionally shaking my legs, and others I might not be aware of. Watching TV and spending a lot of time on my computer can make them more frequent. Hunger can make them a lot more frequent too.
I think stims or tics have a neuro-chemical basis behind them. There's probably quite a bit of information available on this subject too.