Methadone functions by binding to the opioid receptors in the brain, spinal cord, and other parts of the body. This action alters the way the brain and nervous system respond to pain, providing relief. Unlike other opioids, methadone also acts on the NMDA (N-methyl-D-aspartate) receptors, which may help in alleviating neuropathic pain often associated with cancer and its treatments.