All the energy is still coming from gasoline but the H and O are causing the combustion to be more complete which increases the efficiency.
Basically I think H and O are much better for combustion than Nitrogen which is what 80% of our air is made up of. I'm still not sure about the amount of energy required to power the hydrogen cell being as much as the improvement in efficiency.