Bacteria oxidize the organic matter and, in the process, produce electrons that run from the anode to the cathode within the fuel cell, creating an electrical current.
The most common batteries are made up of negative and positive halves (the anode and the cathode), a material to separate them, and "current collector" layers at top and bottom to gather up the electric charges moving through.
The two electrodes, cathode and anode, are separated by a polymer electrolyte membrane which permits protons to cross to reach the cathode while the electrons are made to flow as part of a circuit to carry an electrical current.