Can someone explain how just those threads on the outer nut keep the bolt from turning?
I'll try. If you screw two nuts onto a bolt, then tighten them together, you can lock them anywhere on the threads you like. Since the inner nut on the shifter is trapped in the housing, the outer nut locks the screw in place after it has been tightened the right amount. The two nuts push together when the outer one is tightened. They pull and distort the thread on the screw very slightly, just enough to keep it from turning when the lever is moved. The distortion is temporary: as soon as you loosen the nuts, the screw returns to normal and can be turned.