Basically, since opiates (including methadone) slow down intestinal peristalsis considerably, the stool has more time to sit in the large intestine, which draws more and more water out of the fecal matter until it becomes hard and dry. And since intestinal peristalsis is significantly reduced, more fecal matter has time to build up. It can be extremely painful to push that kind of thing through the anus.
Milk of magnesia, or some other saline laxitive which draws water into the feces, will help. I’m not sure if bulk-forming laxatives are a good idea, because water is critical to making those work – the excess drying out that opiates cause may actually cause those to make things worse. I don’t know – they might work fine, or they might be trouble. In any case, I’m not a doctor and this shouldn’t be construed as medical advice.
This could all be avoided if they would just add methylnaltrexone to methadone, which keeps the methadone from affecting anything but your brain, but so far nobody seems to be doing that.