Deployed spacecraft are expected to remain in operation for years without in-person servicing. The GPS satellite USA-132, for instance, is still operating after it was launched in 1997.
However, mass and volume limitations make it challenging—and often impossible—to load a spacecraft with all the equipment needed for the mission. Dual function systems are thus required, as well as enough electrical power to run the payload and satellite functions.
Fuel cells are one option for powering spacecraft. Fuel cells convert hydrogen or other fuels into electricity. Compared to batteries, fuel cells typically are much more energy dense, which allows them to be more compact and lighter, plus produce electricity continuously for much longer on a single fill.