Naltrexone is an opioid antagonist. This means it works by blocking the opioid receptors in the brain. Naltrexone does not cause dependence and is not habit-forming.
When you drink, your body produces endorphins. These endorphins are actually endogenous opiates (a scientific way of saying opioids created by your body). For many people, the release of these endorphins and the pleasurable feeling they trigger translates into a desire to keep drinking.