Loaded with electronics, modern cars are, & a key fob is no exception. Inside & contains an electronic chip that acts as a transmitter; this broadcasts a signal when you press the button to the door open. A key fob is powered by a battery small.
The battery lasts can for two to three years in a smart key fob & four to six years in a regular fob with keys. Reasons for this spacing are that the smart key fob &, as well as a receiver, has to communicate with cars more often when in or near the car. In key fob, in most cars, the battery is not rechargeable & must be once charged replaced.