The problem the railway (and no doubt other similar industries) has is variable demand for staff, ie: Do you provide sufficient staff to cover every possible eventuality, not just holidays and sickness but unexpected retirement, a glut of retirements, maternity/paternity leave, jury service, etc, in which case for much of the time there will be an excess of spare staff
Well the demand is variable only in the sense that it is not always the case that the same number of jobs will be left open after the daily mark-up has been done. The number of running turns, route refreshers, safety briefs and so on is fixed every day while the number guaranteed annual leave is limited to a certain number which helps to keep things under control. However, as you outlined, there are a number of other reasons for absence, some of which are more prevalent than others.
However, I think that what you're hinting at is where depot numbers dip below the establishment. Clearly this is a big issue and has a huge impact on it's ability to cover it's own work, as the fewer drivers there are the harder they would need to work.
The amount of spare coverage at each depot is set by the depot establishment calculation. This is normally a percentage of the number of drivers needed to cover running turns (where I work this is 50%, or 45% where the number required to cover running turns is 97 or more). These additional drivers are normally sufficient to cover any turns left uncovered. As I've mentioned previously, before the pandemic this number appears to be more or less right, with some days having a few surplus drivers sat spare and some days when rest-day working was required to cover the remaining gaps. This is not necessarily a bad thing, as rest-day working provides the flexibility that helps rosters cover all the work, but where a TOC habitually runs depots at less than the establishment level you end up with a reliance on it which can impact on service resilience. I discussed this yesterday at post #263.
There is a degree to which a TOC can plan for changes in the workforce, but you will never be able to replace a driver like-for-like due to the disparity between the outgoing driver's notice period and how long it takes for a replacement to reach full productivity. TOCs that have a large turnover seem to understand this a bit better than those that historically have had a lower turnover. They basically have driver training programmes that run almost continuously, with new trainees being dropped in at one end and qualified drivers being squeezed out the other. Whether the pandemic means that the training of new drivers will be able to keep pace with the rate at which existing drivers are leaving the industry seems to be the major challenge at the moment.