Harry stares at Snape until he hears Voldemort's voice, magnified to reach all of Hogwarts and Hogsmeade. He tells Harry to come to him in an hour, or he'll kill everyone. Hermione and Ron lead him back through the tunnel and to the castle. When they enter the Great Hall, Harry sees the Weasleys surrounding Fred's body. He sees Lupin and Tonks's bodies too, and races away to Dumbledore's office. Harry pulls out the Pensieve, pours in Snape's thoughts, and dives in.
Seeing that Lupin and Tonks are also dead shows Harry the consequences of not winning: more people will die. This leads Harry to reach for anything that will help him ultimately win, even if it means turning to Snape for answers as to how to do this.
Young Snape looks unkempt. From a hiding place, he watches young Lily and Petunia play. Lily giggles and makes a flower open and close its petals. Petunia is both horrified and desirous. Snape jumps in and says that Lily is a witch. The girls walk away, but he chases after them and says that he's a wizard. Petunia pulls Lily away. The scene re-forms on Snape and Lily sitting in a clearing. Snape tells Lily about the Ministry, and Lily asks if it's all actually real. Snape says it is for them, but it's not for Petunia. Lily asks if it'll matter that her parents are Muggles, and Snape hesitates but says it won't. They notice Petunia hiding behind them. She insults Snape's clothes and a branch breaks over her head. Lily accuses Snape of hurting Petunia on purpose.
Seeing Snape as a young boy shows Harry that Snape wasn't always a cantankerous person: he once was friends with Lily and represented her sole connection to the Wizarding world. Making the branch fall on Petunia suggests that Snape might hold some anti-Muggle sentiment, but at least, at this young age, he shows that he has the capacity to reevaluate these beliefs and come to a better and more generous understanding of how the world works. This ultimately demonstrates the potential power of love and friendship.
The scene changes and Harry and Snape watch Lily apologizing to Petunia on platform 9 3/4. Lily assures Petunia that she'll talk to Dumbledore about letting her come to Hogwarts, but Petunia cries and says she doesn't want to be a freak. Lily points out that Petunia wrote to Dumbledore and asked to come to Hogwarts, and Petunia realizes that Lily and Snape read Dumbledore's reply. The scene changes and Snape slips into a train car with Lily. He tries to cheer her up by saying that she should be in Slytherin, but young James taunts Snape. Sirius joins in, and Lily leads Snape away. Harry then watches Snape be sorted into Slytherin and Lily into Gryffindor.
Though Lily reaffirms her friendship with Snape in front of James and Sirius, it's telling that she then gets sorted into Gryffindor while Snape goes into Slytherin. With this, the novel shows how forces outside of their control began to act and shape these two young people into the adults they came to be, in which Snape turned to Voldemort and Lily became one of the most famous members of the resistance movement.
Harry finds himself following Snape and Lily across the grounds a few years later. Lily hates Snape's friends, who are interested in Dark magic, but Snape points out that James pulls crazy stunts and that something is off with Lupin. Lily says she heard about James saving Snape from what's under the Whomping Willow, which makes Snape angry. Lily angers in return. He says that James has a crush on Lily, which she ignores, but she says that Snape's friends are evil. Harry watches the scene he saw years ago, when James torments Snape after their O.W.L.s, and sees Snape and Lily fighting about him calling her a Mudblood. She accuses him of being a Death Eater and walks away.
Lily's behavior shows that, while she may feel affection for Snape on some level, her loyalties truly lie with the cause and with fighting Voldemort—and shows that Snape made his choice to give up her friendship when he chose to pledge himself to Voldemort. This also develops the idea that Snape loved Lily, even into adulthood, and therefore suggests that he has the capacity to at some point make better choices guided by this love.
The scene changes to years later. Dumbledore meets adult Snape and Snape shares that Voldemort thinks that the prophecy refers to Lily Potter and her son. He asks that Dumbledore help save Lily and offers to give anything in return. The scene re-forms in Dumbledore's office, as Dumbledore tells Snape that Harry is alive and that if he loved Lily, he needs to protect Harry when Voldemort returns. Years later, Snape paces and lists Harry's faults, and then Harry follows Snape and Dumbledore at the Yule Ball. They discuss the Dark Marks getting darker, and Snape says he won't flee if Voldemort calls him. Dumbledore suggests they Sort students too soon.
Dumbledore's suggestion that they Sort students too soon implies that he believes that Snape isn't truly living up to the Slytherin ideals once he becomes a double agent. Helping Dumbledore requires bravery that's often not attributed to Slytherins and, instead, is a Gryffindor trait. With this, Dumbledore gives voice to the idea that Sorting doesn't do students any favors and, in the case of Snape, might be directly responsible for putting him in contact with Voldemort in the first place.
Back in Dumbledore's office, Snape does his best to save Dumbledore's blackened hand. Dumbledore comes to, and Snape asks why he put the cursed ring on. Snape says that Dumbledore has about a year to live, and Dumbledore brings up the fact that Draco is supposed to kill him. He tells Snape to help Draco, makes him promise to protect students if Voldemort takes over the school, and then asks Snape to kill him instead of letting Voldemort or his cronies torture him. Harry then watches Snape and Dumbledore walking on the grounds. Dumbledore says that he's giving Harry information that he can't share with Snape in case Voldemort tries to get it, and then tells Snape that Voldemort won't try to possess Harry.
Snape's promise to protect the students if Voldemort takes over suggests that what's been happening at Hogwarts hasn't actually represented the worst of what could happen: Snape probably did what he could to not totally stamp out Ginny and Neville's resistance efforts, though there was certainly only so much he could do. Asking Snape to kill him shows that Dumbledore understands that, in order to die well, a person should greet death on their own terms—and in this case, this means a merciful death at Snape's hands.
In Dumbledore's office again, he tells Snape that when Voldemort starts keeping Nagini close to him, it will be time to tell Harry the truth: that when Voldemort tried to kill him and was blasted apart, his soul latched onto baby Harry, and as long as that bit of soul is there, Voldemort can't die. Dumbledore says that Harry has to die, and Voldemort has to do it. Snape is aghast and accuses Dumbledore of raising Harry like an animal for slaughter. Dumbledore asks if Snape cares for Harry, and Snape conjures his Patronus: a doe. He still loves Lily. The scene shifts, and Dumbledore's portrait tells Snape to plant the idea for the seven Harrys with Mundungus. Snape digs through Grimmauld Place, pockets the last page of Lily's letter, and then Phineas and Dumbledore's portrait tell Snape where to leave the sword for Harry.
With this, Dumbledore and Snape reveal that Harry is the final Horcrux. Snape's horror at learning this shows that he does have feelings, even if he's not Harry's biggest fan; he still recognizes that raising a child to die like this is unethical and, as far as he's concerned, makes all the other measures he's taken to protect Harry over the years moot. Learning that Snape was motivated by love to the end, however, allows Harry to begin to think more critically about his former Potionsmaster and see that he was a tortured soul, but not necessarily a bad person.