So people say you should change cables because of stretch. But after the cables have stretched, isn't it just easier and cheaper to adjust the cable and pull it a bit tighter? Why do I need to replace the entire cable?
Cable stretch is mostly just things settling into place (ferrules into housing, housing into frame stops, housing compressing) rather than physical stretching of the cables, and after a week or so of installing new cables, you simply adjust them to the right tension. This is normal, as is periodic adjustments of cable tensions involved on your bicycle.
Replacing cables is done for a different reason than "cable stretch". A Bowden cable (see also here), such as the shift and brake cables used on a bicycle consists of an inner wire and housing. As the housing's lubrication wears away(*) or the cable rusts, the cable catches on the housing causing things like the brakes not releasing properly or sloppy shifting. Also, sometimes the cables (which are made of twisted wires) fray and break. If this happens on your brake cable, you don't have braking (which is bad!). Most shift cables fail safely by just forcing you to some extreme gear combination (rear is normally the smallest sprocket). Thus, it is advisable to replace your shift and brake cables periodically.
I have to replace my cables at least once every winter due to corrosion and road crud, for example, but I do have to do cable tension adjustments periodically when the cables are not replaced (such as indexing getting a bit sloppy or to account for my brake pads wearing down or something).
(*) Some people oil their cables. Most manufacturers now recommend against this.
Another reason why I change my cables (every couple of years) is that the ends of the outer casing tend to get crimped and break down. Then you need to tighten up everything and eventually will not be able to take up all slack to create the tension that you need. Also most housings have an SPF rating just like sunblock, although it takes a long time exposure to sun light does take its toll on the cables.
I change my cables when the springs can't return them to the previous position. That means:
With brake cables when the brake lever does not want to return not an open position.
With gear cables when the rear gear does not want to shift out to a smaller cog (higher gear) unless I click twice.
Because while our hands can usually apply enough pressure to move even a rusty / worn cable with friction, the spring in the brake and rear derailleur will gradually lose the ability to move the cable.
(The spring on the front derailleur is usually pretty strong. I have never personally known a front cable to lack the ability to return to the smaller cog. In the case of the front, derailleur, it is extra hand pressure needed that signals to me the need for a new cable).
This lack of movement in one direction (with the exception of the front derailleur) allows me to differentiate between other causes of poor brake/gear functioning, and identify worn cables (though old/rusty springs in the brakes and derailleur are another rarer cause).
It is not necessary, unless it is a very old, corroded cable; or possibly if it has fatigued/over-stretched. That is why they made cable tension adjustable.
If the bicycle has not seen much use, the wear and tear of repeated shifting is not present, which is what drives the need to replace cables.