Undertale spoilers
@kara_dreamer@witches.town basically after going through the game killing your way through everything and after finally killing Sans (despite his grave warning of 'going to have a bad time'), you lose al control of Frisk once you step through the door. It's implied that once you make that final choice, Chara is in control. Your heartless killing despite everything awakens Chara's power completely, and Chara kills Asgore, but Flowey finishes them off in an attempt to win favour.