Methadone helps in treating pain by altering the way the brain and nervous system respond to pain. It also works in treating opioid addiction by alleviating withdrawal symptoms in people who have quit using opioid drugs.
https://recoverypartnernetwork.com/drug/opioid/methadone-addiction