Here is one of the better explanation of how hydrogen fuel cell cars work, prepared by Engineering Explained.
It begins with a fuel cell stack and chemical reaction and then moves to the package implemented in the Toyota Mirai.
In fact, FCVs look just like BEVs, except for the additional electricity generator, which uses hydrogen and oxygen.
"How do hydrogen cars work? What are hydrogen fuel cells? How do hydrogen fuel cells work? How does the Toyota Mirai work? This video looks at how hydrogen (H2) can be used to power a vehicle. An onboard storage tanke send the hydrogen to the fuel cell stack, where the electrons are separated from the hydrogen via a platinum catalyst, and the energy is then used to propel the car. The electrons return to the fuel cell where they then combine with positively charged hydrogen atoms and oxygen atoms to form H2O, and the reaction is complete. The water then flows out the exhaust pipe, with no harmful emissions."