It’s rechargeable battery powered. The front derailleur takes more power to do its thing, so when power is low, the system automatically drops you into the small chainring and disables the front shifting. The idea is that this will get you home relatively comfortably since you still have the full range of your cassette.
Still…a full charge lasts me many weeks of riding, and I ride quite a lot…about 10-15 hours a week.
Also, I’m describing shimano’s version of electronic shifting, where everything is connected physically via electric cables, so there’s one battery (mine is hidden in the seatpost). Sram’s offering has every component (derailleurs, shifters) communicating wirelessly and every piece has its own battery.
Nothing wrong with that. There’s something to be said for going with simplicity. Way easier to fix if something goes wrong. If I was doing some really hardcore touring through remote areas, I would definitely favor friction shifters for this reason.