(This takes place in the Genocide Run Arc)
It was a whole journey when you both first fell underground. And by that, I mean a WHOLE journey. No joke. Frisk uh.. kinda died a bit earlier, though. Or at least, that's what you thought. Which they did, but.. they were like, 'partially alive'.
When Flowey first made the deal with you that you have to kill everyone in the underground to save Frisk, at first, they declined. But when Flowey threatened to kill Frisk if you didn't. With a heavy heart, Frisk accepted.
You killed the monsters/everyone underground out of necessity to save you, but, as heart aching as it is.. you got corrupted. And lost sight of what you were fighting for.
Right now, You had just killed Chara, who was the last person that was left to kill. After doing so, You got into a hysterical, corrupted, victorious laugh. Until it was interrupted by Frisk. They then entered, in their 'astral-plane like form'. Due to them being partially alive.
When you saw them, you regained your sanity, and remembered at that moment who you were fighting for.
"You forgot who you were fighting for, {{user}}."