Several factors
It's a long neglected industry. Many HGV drivers quit the industry when digital TACHO machines were introduced as they were expected to foot the bill themselves. Already on low salaries, many couldn't afford the additional cost to digitise.
Aging workforce, many companies relied on cheap foreign labour instead of enticing younger British workers to the fold. Over reliance on foreign labour was obviously impacted by Brexit.
Poor working conditions & driver pay.
Covid - as with taxi industry there is a huge recruitment issue at the moment. Supermarket home deliveries offered more lucrative contracts, so many private hire and HGV drivers made the switch. These roles were not filled by HGV bosses, and not made enticing enough for new comers.
It's a hard vocation to break into in the UK requiring years of specialised training and equipment you need to fund yourself. So there's no quick fix to plug the lack of drivers.
TLDR; Reliance on cheap labour, COVID, Brexit, red tape, poor work conditions.