Detox gets you off the drugs safely, and a little of what
rehab does.
Rehab deals with learning about your
addiction and how to live life without drugs.
Once you are done with detox, they will help set you up on some continuing aftercare activities. Like an inpatient rehab, or outpatient rehab, a psychiatrist to follow your meds etc. that kind stuff.
Hope this helps?