A microphone output, once you rise above the cheap 'toy' plastic types and ignoring valve mics, will (these days) normally have a 3-pin XLR connector providing a balanced output signal with a differential output on pins 2 and 3, with pin 1 used for the shield connection. It will feed into a microphone preamp (that may be built into a mixing desk, digital audio interface or a stand-alone mic preamp etc.) that feeds the signals into a differential amplifier.
The mic output signals that have opposite polarity and amplitude to each other. If you fed those signals into a summing amplifier, they would cancel out and you'd hear nothing as a result. That's why they are fed into a differential amplifier, which outputs the difference in the signals, so you get a signal that has twice the amplitude of a single signal. The benefit of this is that any noise picked up by both signal cores won't have any reversed polarity to it, so when it hits the differential amplifier, the noise signals (theoretically) cancel out, and the signal comes out noise free.
Obviously the two signal cores can't occupy the exact same space, so there will be some difference in the noise signals each cable picks up. The nearer the cable is to a source of noise, the greater the difference in the electromagnetic noise field experienced by each core. You only get perfect noise cancellation if the noise levels are exactly the same phase and amplitude, so you can still get some noise in the signal, but at a very much lower amplitude than otherwise.
To increase the ability of the cable to reject noise, the two signal cores are twisted together (the tighter the twist the better), so that there's a better chance of both cables picking up the same amount of noise i.e. with parallel cables, one core is always likely to be nearer the noise source than the other, and so the noise amplitude on each cable is always going to be slightly different. Twisting the signal cores averages out the distance of each cable from a noise source, so it's only when the cable is very near to the noise source that they won't pick up the same amount of noise.
Think of the noise signal as ripples spreading out from the point a stone was dropped in the middle of a lake. Near the noise source/stone impact point itself, you've got very small radius circular waves that are quickly expanding into larger radius waves. If you floated a straight piece of wood in the water on a line perpendicular to the circle radius, the centre of the ripple would noticeably hit one part of the wood first then spread out and hit the rest. But move away 100m and the height of the ripples is now much less and the radius of the ripple waves is now so great that it appears almost flat. The same piece of wood set perpendicular to the radius will now experience the ripple hitting all the wood at almost the same time.
Replace the wood with our twisted pair, and the stone for a noise source. Very near the noise, even though the cable is twisted, one core will be that bit nearer and pick up the noise before the other core does, so there will be a very small amplitude and phase difference in the noise signals picked up.
To increase the noise resistance further, an overall braid shield is added to the cable, which captures a lot of the noise signal and takes it to ground. The better quality cables have a lot more wires/copper in the shield than cheap cables (as copper costs a lot these days). Also the tighter the twist in the signal cables, the more copper you need per unit length of cable. So there's a reason why some cables cost a lot more than others.
Cables for installation that aren't planned to be moved at all after installation will typically have a couple of wraps of aluminised mylar foil sheath with a drain wire around the signal cores instead of a copper braid. This provides more comprehensive protection as there are none of the gaps in the shield that a braid gives you (which let in very short wavelength noise). However, these cables are less flexible than braided shield cables and moving them can cause audible noise as the layers of foil move across each other and cause slight capacitance changes and some static to be produced.
For really noisy environments there's 'star quad' cable, which has two twisted pairs that are also twisted around each other. Each pair carries the same signal i.e. two cores are connected to pin 2 and two are connected to pin 3 on the XLR, but the extra cores and twisting helps the noise levels average out a lot more. Typically used for outside broadcast/live situations where there's a lot of generator power and limited cable route choice so you can't run the audio cables away from power cables etc. The downside is that these cables have a lot more capacitance than a standard mic cable, so whilst you could run a standard 'mic' lead around 100m before the sound starts to suffer, you are at least halving that with star quad.
And what is good for mic cable is also good for connecting other items of audio equipment together. The main benefit of using balanced connections between equipment, especially in the digital age, is that it allows you to break the ground connection provided by the shield at one end of the cable to cure any ground loops whilst the shield still provides its extra noise protection. With unbalanced connections, you can't break the shield, because it’s also acting as a signal carrier.
You don't need an XLR to have a balanced cable you can do exactly the same with TRS jacks. And just because there is an XLR or TRS connection doesn't always mean that the connection is balanced and described as above. A TRS cable used for a stereo signal isn't a balanced cable, even though it is probably exactly the same as a mic cable in every other sense.
But finally, back to guitar leads. The most important cable is the one that you plug into your guitar, so don't go cheap on that one. You don't need to spend a lot to get a good cable, you just need to spend enough, with good jacks and a reputable make of cable in-between them. Don't believe the marketing hype of the mega-expensive brands. I have an £80 (Aus$140) 10 foot boutique brand cable that was included in the case candy when I bought my DG Strat, and it sounds no different to my £20 (Aus$35) cables that have the benefit of Neutrik Silentjacks.