Given author J.K. Rowling's online presence lately, it can be argued that the Harry Potterbooks haven't aged as well as other fantasy works. The author's belated revelations about Dumbledore's sexuality among other topics were also criticized as queer-baiting. Still, Dumbeldore remains one of the most controversial and frequently discussed figures in the series, and newcomers who somehow managed not to get spoiled are bound to wonder: did Dumbledore really die in The Half-Blood Prince, and if so, why?
There was a time shortly after the publication of Harry Potter and the Half-Blood Prince that talking about Dumbledore's death was the worst spoiler one could make. "Snape killed Dumbledore" was not a thing to say publicly, since it would spoil newcomers' experience but many did talk about it, to the point that it's now nearly impossible to come to the fandom for the first time without this knowledge.
It was only two years after The Half-Blood Prince that The Deathly Hallows came to explain the circumstances and reasoning behind the fan-favorite character's death. So, did Dumbledore really die?
The short answer is yes. The answer to the question of who killed him and why, would be that Snape murdered him, being a traitor all along. At least that's what fans thought until the seventh and last book of the series came out. Harry Potter and the Deathly Hallows, however, came to tell a very different story.
In the finale of the fantasy, series readers got access to Snape's memories about several events that happened during or before the timeline of the books – including the circumstances of Dumbledore's death.
It is revealed that Snape, who felt guilty for unintentionally allowing the death of Lily Potter whom he loved, decided to act as a double spy; Dumbledore's people believed that the former Death Eater had joined their side, while the Death Eaters believed that Snape was only spying, while actually being devoted to the dark side.
The series provides plenty of opportunities to question Snape's loyalties and only at the moment of his death are we 100% certain that he was actually loyal to Dumbledore. From Snape's accounts about Voldemort and the Death Eaters, Dumbledore was able to organize his counterattack.
It turns out that Dumbledore's plans reached further than most fans could guess; as far as his death and beyond. Shortly before the events of The Half-Blood Prince began, the headmaster of Hogwarts had come in content with a powerful ring which was actually a Horcrux. While Snape managed to contain the ring's evil power, part of it remained in Dumbledore's body and was going to kill him very soon.
Meanwhile, Dumbledore was informed that Draco Malfoy had been tasked by Voldemort with murdering him. Believing that Malfoy wasn't beyond saving, the already dying Dumbledore decided to pass on his own terms. Dumbledore ensured that Snape would kill him instead.
This was a strategic choice that consolidated Voldemort's trust in Snape, allowing the latter to keep secretly working for the good side from a position of power. But Dumbledore's plans reached beyond his death. Through his clever manipulations, his death caused a chain of seemingly unimportant events which all turned out to be linked, allowing the defeat of Voldemort.
For fantasy fans, Dumbledore's death is one of the most memorable twists. The truth behind the reasons for his death is even more complex and frankly hard to take in at a first read. No matter how we feel about the books now, it's hard to forget that time when "Snape killed Dumbledore" was the worst form of spoiler.