XLR connectors are "always" balanced, and are much more likely to have a locking mechanism that prevents accidental disconnection.
1/4" connectors come in two varieties, TRS and TS.
TRS (tip-ring-sleeve) are for carrying balanced signals, or two different signals such as stereo, or one output signal and one input signal (mixer insert I/O jacks.) They have two signal conductors and a ground.
TS are for unbalanced connections, and have one signal conductor and a ground.
Balanced cables generally carry a 3dB higher signal and are less likely to accept interference from nearby RF sources.
Oh, and to address the simple question of, which one should you use if you have both choices, I always go with XLR. Partly because I like locking connectors, partly because I have about 20 extra XLR cords of varying length in my tool box and at least a dozen extra 20 foot mic cords with me.