Exactly. That spark ignites a gas/air mixture in an enclosed space (the cylinder) and the rapidly expanding gases force the piston down. Put several pistons together and time the explosions correctly and they can smoothly turn the crank.
Just like the old steam powered cars didn’t run on water (they heated water into steam, so they really ran on what ever you were using to heat the water) these modern claims of running on water by splitting water into hydrogen and oyxgen aren’t running on water either.
They’re putting in a whole bunch of energy to break the hydrogen bonds to the oxygen molecule, so the car is running on what ever they are using to make that energy. Since that energy will always be less than the energy you get from 2 hyrdogen and 1 oxygen (water is a very stable bond) you will need an outside power source.