Like how a gun works, essentially a battery for the initial motion, using the subsequent motion storing some for the next initial motion.
They definitely do not work by using a depleted battery to charge a second battery to create energy out of nothing.
The original poster was proposing a closed system where you would turn water into hydrogen (a very energy intensive process) and then turn it back into water (an energy releasing process) inside the car to provide all the energy. This is not how physics works. You cannot use your energy source to create more of your energy source without an external energy source. It just doesn't work that way.