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.