Lithium ion batteries have their own oxygen from the cathode to burn with, not external sources like water .
The cathode such as LiMnO2 contains oxygen and the cathodes are susceptible to thermal breakdown, so when they get hot they release oxygen , quite a lot of oxygen, above 150C ( 302F).
The batter also contains an electrolyte which is typically Lithium salt in an organic solvent. The organic solvents will break down above certain temperatures and that breakdown is an exothermic reaction that generates more heat , so things can get bad quickly , hence the ‘ thermal runaway’ phrase. As the electrolyte breaks down it produces ethane and other combustible gasses so you have a mixture of oxygen, flammable gasses , self generating heat and lithium all held together in a little can.
Things can start with something causing a temperature rise in the battery, poor cooling, attempts to over charge, charging of a more depleted cell form adjacent cells , mechanical damage. That’s what a lot of thought goes into the design of battery circuits for both rechargeable and non rechargeable packs. Lots of fuses , diodes, balancing circuits etc. The packs are not just a bunch of cells connected together as you we see in products where you pop in a few AAA cells.
Once the cell for whatever reason gets above 90C the electrolytes are starting to generating their own heat, the solid interface arround the anode will breakdown, also an exothermic reaction raising the temperature further, now the electrolytes and the anode can come in contact making more combustible gasses, and the battery internally shorts out, so yet more heat and the we get the release of the oxygen from the cathode and that reacted with the gasses for even more heat , or a klabloooie moment.
No water needed for the lithium to react with. The electrolyte is plenty of fuel all by itself.
A cell could burn in water , but generally the water around would probably cool things down.
For an EV car fire, you have a whole lot of energetic fuel , with its own oxygen source , and that will burn pretty fiercely , and set fire to all the other stuff in the car that burns like the tyres, upholstery, all the plastic ( which is the same for an ICE vehicle)