As with anything hearing aids have a bathtub curve for reliability and some models are better than others. The NHS tends to buy in massive bulk slightly outdated models (2-3 years old) at HUGE discount (like £60-120 per aid on average) which are no longer sold to Private healthcare users in the UK and Abroadshire.
With standard BTE aids some parts are considered replaceable like the tubing and the mould/dome and various attachments, lifespan estimated 3-6 months but some get longer, some don't. A lot can depend on how acidic your sweat is for example.
I don't know if the NHS recycles rechargeable hearing aid batteries, they will be fairly small capacity by the standards. I think most NHS aids are still disposable batteries due to rechargies not lasting long and still being more expensive. There's pros and cons to rechargies, if you forget to charge or can't charge you're stuffed (unless you can also use disposables or get a different battery part).
Usually the main electronics bit can keep going for as long as snappy plastic survives and the electronics cope with whatever they're exposed to. That's likely to depend on the user e.g. older person who doesn't go out much may get longer than a middle aged person who does sporty stuff or in/out of rain and a lot longer than they'll last for a child (children are notoriously hard on hearing aids). The failure is likely to be electronics and they're sealed units so they don't really repair them, it's cheaper to just go with a new aid at £100ish a pop compared to time cost of repairs. Modern aids are on average more reliable than the old analogues because they're digital and have fewer actual wires in.
As a child, I had a wonderful hearing aid repair technician who used to have my back when I reported faults that the repair centre (I had obscure aids which he couldn't fix) said weren't faults. I believe he once sent my aid back 3x (when I was about 5) and eventually they dismantled it and discovered a loose wire - which I could hear. Lovely man who understood that those of us who use an aid everyday know when it is wrong.
Most NHS areas will leave you with your aids for as long as they work (and you're happy with them). If you go back after say 3 years or so, for whatever reason, there's a chance you'll get a new model because of the way commissioning works. Although some friends of mine say their audiology punishes them by removing their upgrade if they ever lose a hearing aid even if they pay the £50-150 fine for it...
One gotcha is if you move house with working but old aids and keep going till they die, cos then you need a NEW referral from GP which can take A Long Time TM. A profoundly deaf friend did this, his aids died age 11 and his GP said it'd be 12 months for an audiology appt so he had to go private cos he had only 1 half working aid and desperately needed them for work and y'know hearing everyday life. I'd have kicked up A Stink in his shoes but I suspect he couldn't go to Shitty Specsavers/Scrivens/Boots cos he was severe/profound which makes him 'special' in audiology terms. So if you move house, and the aids become 4-5yrs old, get a new audiology referral in before they die so you're back on the books...
I think sometimes working but old NHS aids are collected up and taken to poor countries for reuse but there's challenges with maintaining and setting up random aids and indeed they're likely to be unreliable before they hit very hot and or humid/dry climates and people living there may have difficulty accessing electricity or batteries and ongoing care.