The answer is not simple.
Often the answer is obvious–always washing your hands 5 times is a compulsion. Yelling “What’s that?!” many times a day because it just feels like you have to is a complex tic. Even when the phenomenology is less classic, one can usually tell them apart by asking why the person does it and by carefully assessing for obsessions. In the definition of compulsions, below, even if there is no obsession, usually compulsions aim to decrease anxiety or prevent something bad from happening. By contrast, with complex tics, sometimes there is no premonitory phenomenon, but when there is, it is not an obsession, and usually it is sensory in nature (“e.g., my throat feels funny so I clear my throat”).
Technically, however, a given repetitive action can be both, because the definitions can overlap (see quotes below from DSM‑5). The italicized parts and the “Note” below mean that it can be especially hard to tell them apart in younger children. (I added the italics.) Also some typical compulsions (like stimuli to left and right sides needing to be equal) often have only a physical sense that (say) the hand that was touched feels weird and it doesn’t feel “just right” until the other side is touched, too. That’s really more of a sensory phenomenon, though one could argue that assertion.
Finally, some obsessions and compulsions are much more common or rare in people with tics than in other people with OCD. Example: symmetry concerns and evening up are more common in tic patients, whereas contamination concerns and handwashing are much less common in tic patients.
Definitions from DSM-5:
- “A tic is a sudden, rapid, recurrent, nonrhythmic motor movement or vocalization.”
- Compulsions are defined by (1) and (2):
- Repetitive behaviors (e.g., hand washing, ordering, checking) or mental acts (e.g., praying, counting, repeating words silently) that the individual feels driven to perform in response to an obsession or according to rules that must be applied rigidly.
- The behaviors or mental acts are aimed at preventing or reducing anxiety or distress, or preventing some dreaded event or situation; however, these behaviors or mental acts are not connected in a realistic way with what they are designed to neutralize or prevent, or are clearly excessive.
- Note: Young children may not be able to articulate the aims of these behaviors or mental acts.