Electrolysis splits the water into hydrogen and oxygen.
The cell liquid (electrolyte) is not electrically conductive but it does allow diffusion of the lithium ions through it as that’s how they get from the positive side to the negative side and back again.
You can have iron underwater and not rust if you remove the dissolved oxygen.
(Not that u should discharge ur cells in water but people were talking about if iron always rusts under water)