While Snape had been protecting Harry Potter for years, Voldemort believed Snape was his ally and had handed him the Elder Wand. In his final act, Snape shielded Harry from Voldemort's Killing Curse, effectively taking the blow for the boy he had protected for years.