Snape died at the Shrieking Shack without telling Harry about the Horcrux hiding in his scar. Harry went ahead and defeated Voldemort, not knowing that his fight was far from over. After 22 years and 3 wizarding wars later, he finally understood why the Dark Lord kept coming back. Exhausted by decades of wars and left with no other choice, he stepped into the Veil of Death.