Simply put, a fuel cell converts chemical energy into electrical energy in the same way that a battery does.
(a fuel cell; converts; chemical energy; into electrical energy) (the same way; does; a battery)
a fuel cell the same way
converts does
chemical energy into electrical energy
a battery