When the dose of the drug is reduced or the drug is stopped, the difference between what the brain ‘expects’ and the actual input of the drug is what causes withdrawal effects. A similar process happens when people stop caffeine or smoking.
Withdrawal effects from antidepressants can last for months or years in some people, probably because the adaptation to the drug can last for this long. This may be the time required for the brain to re-adapt to less drug being available.