Alcohol detoxification1 - detox for short - is just a way of getting you off alcohol safely and comfortably, if you suffer from withdrawal symptoms when you stop drinking.
It's necessary - if you're physically dependent on alcohol - to avoid what can be dangerous complications of withdrawal, and to make you comfortable enough so that stopping is manageable. But it's not a treatment that's going to help you stay off alcohol.
It's important to understand this - it's just a way of stopping. Detox should only ever be a part of treatment, it should just be the start of things. It's like jacking up your car to change the wheel. Necessary, but you've got to stop driving over broken glass.
Detox is for dependent drinkers who find themselves having to drink to stop withdrawal symptoms.
The most common withdrawals are:
To measure your dependence on alcohol, try the Severity of Alcohol Dependence Questionnaire.
For severely & moderately dependent drinkers, it's not safe to stop drinking suddenly without alcohol detoxification. Withdrawal can become dangerous or even life-threatening. This is why people are often told not to stop drinking when they first ask for help with their alcohol problem.
For less dependent drinkers, it's uncomfortable but not always dangerous to stop drinking suddenly. A detox could still be the best way of stopping drinking, if you suffer anxiety, agitation, panic, fear and insomnia so much that you can't put up with it.
As explained here, if you've been drinking steadily, every day, for many months or years, your body gets used to alcohol being ever present, dampening everything down. So your nervous system and body tissues gradually adapt and learns to work extra hard to fight against it, just to function normally.
If the alcohol suddenly isn't there any more - for example first thing in the morning - then your nervous system has nothing to push against. Until you have had your first drink, it's working at well over 100%, which is where the withdrawals come from.
Detox works by replacing drink with a drug that is similar enough to alcohol to stop any withdrawals (most commonly Chlordiazepoxide, sometimes called Librium®, is used). The dose is adjusted at the start of the detox to make you comfortable, and is gradually reduced so that your body gets a chance to return to normal. This usually takes around 7 to 10 days.
There are slight variations in the medication used, and the particular regimen, but this is the most common method.
1 more properly and accurately called medically assisted management of alcohol withdrawal