Harry survived the Killing Curse the second time primarily because he was the true master of the Elder Wand, which refused to kill its rightful owner, and due to the lingering magical protection from his mother's sacrifice that was intertwined with Voldemort himself.
The Elder Wand's Allegiance
When Voldemort cast the Killing Curse (Avada Kedavra) at Harry in the Forbidden Forest, he was wielding the Elder Wand, one of the three legendary Deathly Hallows. Unknown to Voldemort, Harry Potter had become the Elder Wand's true master. Harry gained this mastery by disarming Draco Malfoy, who had previously disarmed Albus Dumbledore, the wand's former owner.
The Elder Wand's allegiance lay with Harry. A wand cannot truly harm its true master. Therefore, when Voldemort attempted to kill Harry, the Elder Wand refused to carry out its master's demise, making the curse ineffective against Harry himself.
Lily's Protection and the Horcrux
Beyond the Elder Wand's refusal, Harry's survival was also rooted in a profound magical protection stemming from his mother, Lily Potter's, sacrificial love. When Voldemort initially tried to kill baby Harry, Lily's sacrifice created an ancient magic that deeply protected Harry.
Crucially, when Voldemort returned to power, he inadvertently tethered Harry's life to his own by using Harry's blood in his resurrection potion. This meant that Lily's protection continued to flow within Voldemort.
When Voldemort cast the Killing Curse in the Forbidden Forest, it did not kill Harry. Instead, the curse acted upon the piece of Voldemort's soul (a Horcrux) that had accidentally attached itself to Harry during the first failed Killing Curse years earlier. The curse effectively destroyed this Horcrux, eliminating the last fragment of Voldemort's soul, without harming Harry's own life force.
The Master of Death
Furthermore, Harry was the true master of all three Deathly Hallows (the Elder Wand, the Resurrection Stone, and the Cloak of Invisibility). This unique status as the "Master of Death" meant that when the Killing Curse hit him, he was able to choose whether to succumb to death or to return to the living world. In the limbo-like King's Cross station, Harry made the conscious choice to return, leaving behind the destroyed Horcrux.
In summary, Harry's survival was a complex interplay of the Elder Wand's loyalty to its rightful master, the enduring power of his mother's love and sacrifice, and his unique status as the Master of Death, all of which converged to ensure his ultimate triumph.