Most stock headphone cables are constructed with very thin conductors and encased in enamel insulation. Unfortunately, as the headphone cable is bent, twisted, etc. with normal use, the enamel insulation tends to wear out. In the long run, the conductors are no long insulated from each other, so you have shorts within the cable, rendering it useless. A cable upgrade remedies a few things:
The insulation for each conductor is encased in teflon, or some plastic which will probably never breakdown from normal use (at least within a person's lifetime).
The conductors in an upgraded cable are usually thicker (most DIYers use microphone cable, due to the ideal number of conductors), which will provide a less resistant path for the signal to travel (ideally, you want no resistance at all, but this is physically impossible).
The conductors of a higher quality cable contain a higher purity of copper, which will once again provide a lower resistance due to its more organized molecular structure. In addition, the wire is treated to slow down oxidation.
Hope this helps!