http://wiki.nesdev.com/w/index.php/APU_MixerBasically the three channels tri/noise/DMC share a single digital sum output, but the DAC that's connected to is a nonlinear curve. Low output values are farther apart, high values are closer together. This means that if the DMC output value is high, the effective volume of noise and triangle is lowered. (SMB and Startropics both intentionally use this as a crude way to make the triangle a little quieter. Many homebrew NSF composers have done the same.)
The pair of squares have a similar problem on the other DAC.
The exact nature of the curve I don't think has been accurately documented. Blargg's old approximation doesn't seem quite right to me, but it's widely used. I'm planning to start measuring it thoroughly in the near future, actually.