“Is this real? Or has this been happening inside my head?”
-- Harry to Dumbledore at King's Cross (DH35)
After Voldemort struck him down with the Killing Curse in the Forbidden Forest (DH33), Harry finds himself lying naked and without his glasses on a sort of floor surrounded by a bright white mist. Slowly his surroundings take on the shape of King’s Cross Station in London, and when he wishes for clothing, he finds a warm robe to put on. Hearing a sad whimpering sound, he discovers a horribly deformed naked child curled up and crying under a bench. His impulse is to help the pitiful thing, but he is also afraid of touching it. The deceased Dumbledore appears beside Harry and tells him he can do nothing for the stunted child, which represents the soul-bit of Voldemort that has been attached to Harry’s scar from the time he was attacked as a baby (PS1) until his sacrificial death in the forest removed it (DH33).
Dumbledore and Harry discuss the fact that on the night Harry’s mother gave her life to protect him, she imbued his blood with special protection that would keep him alive. On the night he was reborn in the Little Hangleton Graveyard, Voldemort put some of this blood into his own body (GF32), and therefore that protected them both from death. Dumbledore also explains the behavior of Harry and Voldemort’s wands with their twin cores, and the fact that the holly wand had absorbed power from Voldemort’s yew wand in the graveyard when the Priori Incantatum effect occurred (GF34). That was why even when Voldemort used Lucius Malfoy’s wand during the Battle of the Seven Potters, the holly wand destroyed it (DH4). Fear of Harry’s wand drove Voldemort to search for the owner of the Elder Wand, which led to the death of Severus Snape, something Dumbledore never intended. He tells Harry he meant for “Poor Severus” to end up as Master of the Elder Wand, but Draco reached the Tower first and disarmed him before Snape could get there (HBP27, DH33).
Dumbledore confesses that he had been arrogant himself, and that he and Grindelwald were just as obsessed as Voldemort with seeking power, which ended with the tragic death of his disabled sister Ariana. Even after that, as Dumbledore taught at Hogwarts, he still wished to be Master of Death by owning all three of the Deathly Hallows so he could be invincible. After killing Grindelwald and ending World War Two ((PS6), Dumbledore years later asked Harry’s father James if he could keep his Cloak of Invisibility, and years after that put on Marvolo Gaunt’s ring which contained the Resurrection Stone so he could summon the spirits of his dead sister and mother (HBP10, DH33).
Dumbledore tells Harry he is not truly dead, and thus has a choice. He can catch a train and go “on” from King’s Cross, presumably to the real afterlife, or he can go back into his body in the Forbidden Forest and try to save more lives and souls. Harry chooses to return to his body.
Regarding Dumbledore's "Do not pity the dead..." line, cf. Shakespeare's Hamlet, Act I, scene v, lines 4-5. -BB