In my experience, brake cables rarely fail. Only derailleur cables seem to fail, from inadequate bending radius/shifter design limitation/fatigue.
As mentioned earlier, brifters tend to eat cables. I have much more experience with SRAM grip shifters, and they never ate a cable, because the greater bending radius doesn't fatigue the cable wires as much as brifters.
My top pull / top swing XT front derailleurs would eat gear cables every 6 months/3-5,000 miles. As my bottom pull FDs lacked the same short radius pulley mechanism, there was no cable bend and no failures.
Never had a rear derailleur cable fail until I incorporated a Jtek adapter to marry a Campy Ultrashifter to a XT RD.
Bending cables = BAD.
Coincidentally my next bike build will probably use a bottom pull FD and SRAM grip shifters, so I expect carrying a spare gear cable will be unneccessary.