To put it simply.....to manipulate/vary control and trajectory.
For example, in a normal set of iron shafts, the shafts are tip trimmed progressively more from 3i to wedge to stiffen them up and lower trajectory with the progressively higher lofted head.
In woods, its the same, you can tip trim a wood shaft more to stiffen the tip and lower the trajectory in a shaft when using it is a 3w versus a 5w. Tim Hewitt used to say that most wood shafts don't need tip trimming for many golfers and maintained that tipping instructions were only put in place to keep people from calling in and asking questions 😉
I typically play a stiff flex in my irons when using a stock set. however, i like high soft landing long irons , normal trajectory on mid-short irons and a low and boring trajectory in my wedges, as such I like to have softer than stiff flex shafts in my 4/5/6 and stiffer than stiff in my pw,gw,sw,lw ( a bit similar to to what flighted shafts try to achieve)
same in my driver, last year I used regular, stiff and xtra stiff shafts in my drivers. when using a 9 Ping G30 I used a regular flex, as the combo of loft and shaft gave me the correct trajectory. In my Cobra 10.5 , I used an X-flex Graff Blue and got the same perfect trajectory.
Stiffness really only affects two main parameters, trajectory and feel.
I'd also say that a third parameter , dispersion, is also improved with increased shaft stiffness, as long as one doesn't overswing
I also manipulate shaft stiffness with head weight.
then there is the whole issue of no standard between shaft companies on what the Letter X, S, R mean. one companies S can be another companies R and even within the same shaft model a shaft that is labelled S might actually be an X or R