Short answer: that was likely all in her mind while she was prolonging her life.
She was coming to grips with her life choices after the confrontation with Baylan. The first line in Ep4 recap "Your legacy, like your Master's, is one of death and destruction", whether her time as training as a Jedi was all a fraud or if Anakin actually taught her something worthwhile. She could have chosen not to continue to fight and literally drown, she could have chosen to live but become like Anakin, a soldier in a life of killing, and strike him down (there was a brief moment where you could see Ahsoka with the sith eyes). Or choose to live and move on to become something better.
This was a cinematography / style episode meant to put a lot of Clone Wars and some Rebels stuff in live action. Made so nerd fans can geek out over seeing Rex, Hayden Christensen playing CW Anakin, Jacen showing some force sensitivity, a look at the World Between Worlds despite not being there for real, and yes even the Purgills from Rebels.