There are two aspects here:
- Remote locking. This works off the onboard (rechargeable for this key type) battery. It recharges while in the ignition just like an electric tooth brush on its stand. The battery may give out after many years but it's working here. Sometimes the key can need resyncing (some call it reprogramming) to the car. But that procedure is purely for the remote locking and does not affect starting the car
- Starting/security. There is a transponder in the key that talks to the EWS module via the ignition barrel toroidal coil (like your credit card contactless payment). It is not dependant on the key battery as the remote is. Its powered off the toroidal coil. Assuming other keys are working either the transponder is knackered or the key has been locked out by a previous owner. Individual keys can be blocked (for instance if lost). The transponder is one shot coding and either you need to cook your own replacement (£4) with an AK90 programmer (£50) or you need an auto locksmith. DIY is not for the faint-hearted but it's possible. The AK90 can also be used to unblock a key. I have recently got into this and created a couple of keys so far. Or you need an all new £200+ key from a BMW dealer.
If all of your keys fail to release the starter (this is the main action of the EWS other than to handshake security codes with the DME) then you have an all together different problem. But I doubt this is the case otherwise you would have said.
My guess is it's a spare key that has never worked for you? If so perhaps a previous owner thought he'd lost it, had a locksmith/BMW dealer deselect the key from the EWS and subsequently found it. Alternatively it may have gone in a washing machine or got wet and caused the transponder to stop working. Or maybe the transponder just gave up but I've never heard anyone on any forum (and I did a lot of digging when I was researching the EWS recently) complain about a failed transponder.
There is a guy I use to repair faulty remote actions on keys. He's salvaged 4 (non BMW) keys for me so far that have variously gone in the washing machine, been run over by a lawn mower and developed cracked circuit boards. He
might be able to diagnose a faulty transponder and/or clone it if you just send the key to him. Email him first, he charges £30 ish flat fee.
https://www.keyfobrepair.co.uk/
Or I am working increasingly with this guy who I am using to cut key blanks for me (the only bit I can't do). He also may be able to code a transponder email
telecommann@hotmail.com, seller
https://www.ebay.co.uk/usr/telecommann on ebay.
Or our very own
@Ducklakeview could probably help out. He can do a whole new key for £60 if you send him your EWS.
I could in theory also sort it for you but I don't really want to get into doing that, not least because
@Ducklakeview already provides the service on here.