The title makes it seem like the hallows are part of some magic charm to kill Voldemort but that's not quite what I wanted to say. These are really two topics, but they go hand-in-hand in the story and are worth mentioning together.
First, what exactly are the Deathly Hallows? The narrative makes it seem at some point as if the three objects unlock some sort of power if brought together. "Master over death." That's not what they are, in reality, but the legend factors into the "spell" Dumbledore "cast" to defeat Voldemort.
What are the hallows? Simply: Each of three different attempts to answer the question, "How does one beat death?" The question arose among the Peverell brothers, one ambitious, the other in mourning, and the third a sort of philosopher. They each had a reason for gaining an interest in the topic, and so they raised the question together, but each developing a different philosophy for answering it. This meeting of minds was not so much a plan to create a set of hallows, but rather a mutual starting point for a quest to address a philosophical question in three different ways.
One brother figured that power, as always, was the path to defeating death. His journey transitioned into a quest for power. There's no sense that a powerful wand could blast Death. Instead, it's more of a philosophical retort to mortality, in that power itself is the best protection against death's harm.
The next, whose interest was driven by loss, figured that the main problem with death was the sundering it caused, and if those separated by death could reunite, the sting of death would be totally defeated. Mind you, this is not magic to reverse death or change it, rather it's an answer to the question of how to best death, philosophically. This includes besting the pain or harm death causes.
The last brother had the most whimsical interpretation of the question, understanding the paradox of the question itself. Not one of the brothers was trying to gain immortality. They were addressing the metaphorical conquest of death, the overcoming of the pain death causes. The last brother understood that death's inevitability means that trying to best it is a folly. So, his philosophy was that when death is inevitably met, it should be met on the best possible terms.
Each hallow contains an irony, related to the paradox.
The Elder Wand can truly defeat anyone in combat, but only if you have its allegiance. You can gain its allegiance by besting its former owner, and that does not include having to win a head to head deathmatch against them. So, while the wand can win head-to-head matches, the owner must be on guard 24/7, and may lose the wand while not on guard. The wand itself paints a target on its owner, if the owner uses its power too flagrantly. This fulfills the paradox. Yes, it's almost all-powerful as a wand, but it doesn't make the user all-powerful and instead actually puts them at great risk.
The death stone causes those lost to death to return to its user, in theory healing the pain caused by death. However, its irony is that it doesn't restore life to the dead. Again, the hallows are not immortality tools, but answers to a philosophical question that's ultimately a paradox. So, the restoration of lost loved ones without restoring their life only causes the user to develop a longing for death. To cure the loss by joining the dead in their own land. The stone in this sense totally "cures" those who mourn, or rather it strongly enables that. However, the "cure" is death. The paradox strikes again.
The invisibility cloak is the only hallow made with the paradox in mind. Its exact role as a hallow is very unclear, but after I explain something you'll understand exactly what makes this essentially ordinary magical object a hallow.
There is a film called "About Time" where a family of people has the ability to go back in time to inhabit their own bodies in the past, essentially reliving events or even changing them. Sort of like Groundhog Day on demand. The difficulty is that any change to the past sets off a butterfly effect which can change the genetic mix that occurs at conception, so if you have a baby born and go back in time after that and change something, you'll end up with a different baby. This is unacceptable to the time traveler, so after a birth, it creates an effective wall where you can't go back in time before that, at least you can change anything anymore. Since this ability lets you live multiple lifetimes and try multiple things, but has limits like the above, the main character's father (played by Bill Nighy) develops a philosophy to use the power a certain way and stops trying to change the past or travel through time so dramatically.
What Bill Nighy does is decide to live each day of live only twice. Everyday once, then a second time over again immediately, and never use time travel otherwise, and slowly wait until death comes. The philosophy of this is simple. One day's repeat can't change who you are fundamentally, you can't rewrite major branches of history, etc. However, if there are minor pitfalls you encounter, snafus, outbursts, you will have the ability to avoid them. Also, while you can't cause wonderful things to happen, since you're letting time flow naturally, if something truly wonderful happens, you can relive it once to really savor it, then you don't need to go back again and again to relive it. If you relive something over and over, you get stuck in it and never live the rest of life. So, best to have the chance to really savor it once, knowing it's coming.
I think the invisibility cloak inventor had a similar philosophy. The perfect magic to "best Death" wasn't extraordinary magic. Rather, the inevitability of death had to be embraced, so the best way to confront death was to live your best life. Not a life where you're more than what you were born to be, but a life where you can be the best version of what you are. The invisibility cloak is unable to defeat serious magic. If people really want to protect something, the cloak won't help. However, for day to day life, even harrowing situations, the cloak is really really powerful. It's really the proportionality of the cloak that makes it so remarkable. It's not godlike magic. It's mid level magic, but very effective, best-in-class midlevel magic. The intent of the cloak isn't to best any foe. It's simply a strong advantage, that can provide extraordinary opportunities. The philosophical answer is that the item which bests death isn't all powerful, but rather a very useful tool that grants access to extraordinary opportunities which give a talented wizard enough of advantage to live a more interesting and fulfilling life.
That's about all there is to the Deathly Hallows, and the legend around them is probably just that. Embellishment that misunderstands the philosophical nature of Peverell brothers' quest. However, the legend factors into Dumbledore's plans.
Dumbledore's Spell
First, a bit of magic theory. One secret about magic is that it follows a rule of proportionality. This isn't commonly discussed because magical people would have a natural intuition and be able to sense magic directly and know what might or might not work. Charms were invented as reliable, repeatable, teachable acts of magic where proportionality was inherent. This is for less advanced users to not have as much intuition or sensory skills when doing magic. Wandless magic would be very dependent on sensitivity to proportionality.
Part of the premise of proportionality, if we look at it logically without having wizard's intuition, is that magic is doing things that could be done the hard way, but is exploiting situations where the cause and effect of an action is minor even if the action seems very large from a scientific standpoint. Repair a large bridge with the flick of a wrist, sure. However, you can't build a large bridge simply with the flick of a wrist. A bridge can be demolished with a small blast, but it can't be built so easily. The repair charm is in proportion to the demolition act, not the building act. Understand?
What this means for very advanced magic users is that really advanced spells become intermingled with what appears to be simply a very detailed, almost convoluted plan. However, as that plan integrates acts of magic and deep magic, two things occur: first, fate begins to favor the unlikely elements of the plan, and it gains a lucky momentum, second, acts of magic related to the plan become more powerful.
Another way to think of this is that advanced magic is quite like a Rube Goldberg machine. Alternatively, the book "Johnathan Strange and Mr. Norrell" provides an example of how the entire story arcs of the main characters was nothing more than a plan-inside-a-spell that was cast specifically to overcome prophecy and the power of a fairie demigod. Humans and their activities and emotions can become bound up inside of a single powerful, advanced spell as ingredients.
In my opinion, this effect relates to prophecy. What prophecy is, ultimately, is the imprint of an advanced magical spell becoming so strong that its bind to fate overrules the veil of history. One outcome or another must come true, due to the power of the magic, and so a sensitive person can see some of that outcome in the future. It won't change history, since the prophecy is a product of something that has inevitability.
and either must die at the hand of the other for neither can live while the other survives
This prophecy is fascinating, and its language is a clue at something which inspired Dumbledore's actions.
One the one hand, the prophecy is a product of Voldemort's "advanced magic" spell, which is to become the master of magic. Voldemort's aim is to gather all magic into himself. Yes, indeed. Consider the world order he hopes to build. In this world order, magic users are only to exercise magic at Voldemort's pleasure. Basically, magic is on loan from Voldemort, making him its effective master. This is another one of those "advanced" spells where things aren't cut and dry, but at an effective, causality based, intuitive level, an extremely powerful effect is achieve which magic will actually respond to literally not only figuratively.
This is just my opinion, but my theory is that the "master of magic" spell is a curse on its caster, which is why no one has ever succeeded in such an endeavor before, which is what makes Voldemort uniquely bad. Some process in the ancient past took what might be primordial magic, the power of the gods, and set it into an architecture, much like the patterns of the stars are set above. The result of this are limitations on magic. I would even go so far as to say that muggle science is practically a crude version of "old magic" where intent is translated into consequence. I would argue that the developers of science such as Francis Bacon etc. were all students of magic, though perhaps lacking magical ability. It's theory of magic that was used to develop the scientific method, and so advanced magic is built on precise cause and effect, management of intent, and respect and manipulation of greater forces.
This all implies that a "master of magic" spell breaks the rules of the celestial/magical architecture, and so magic itself will fight back against he who might cast such a spell. Any witch or wizard capable of this kind of god-tier magic would also have the intuition to clearly see this limit. What makes Voldemort special is his upbringing grants him not only psychopathy, but an almost magical sociopathy, where he possesses strong magical intuition, and yet some link is broken. For some reason, he can't quite process or connect with the reality of what he sees. He understands the limit but it is unable to affect or deter him. It's a long game of dodging magical accountability and causing mayhem in the process.
It's this process, as a spell, that generates the Trelawney prophecy. However, the curious language involved clued Dumbledore into something greater. The prophecy is the imprint of TWO spells. While Voldemort will inevitably face the wrath of magic itself blowing back against him, he might do untold damage in the process. The question is can he be stopped before that damage occurs?
The other spell in the prophecy is Dumbledore's counter-curse. The undoing of the master of magic spell.
and either must die at the hand of the other for neither can live while the other survives
Either has two meanings (as does neither): first, as indicating two alternatives, second, as indicating similarity.
The word either could imply that either Harry or Voldemort must die, but not both. However, it could also mean that Voldemort won't live, and Hary won't either. The ordering of the word implies the first meaning, but that's what's interesting about the entire statement as a prosaic riddle. A riddle that magic itself was trying to tell to Dumbledore. One which says, "It's this way now, but inside of this situation is the possibility for another situation to one who is clever enough to lay down its roots."
So, on the surface the statement means, "Either Harry will kill Voldemort, or Voldemort will kill Harry, because if one of them does live, the other will have to be dead."
The use of neither is out of place, and that's the clue. What the prophecy is really saying, or could someday mean to say, is this: "Both Harry and Voldemort will kill each other, because both have to die, but in the end once Voldemort dies, Harry will survive."
Once baby Harry survives, Dumbledore starts to sense the real meaning of the prophecy (that is, he's starting to sense the imprint of a spell he must cast and this is the beginning of an act of magic). Harry's survival is shocking and pertains to the rumors around the prophecy, but doesn't quite fulfill them.
Dumbledore understands that Voldemort's "master of magic" spell is backfiring, literally, against him. Magic is biting back. In context with the prophecy, Dumbledore understands that Harry has been marked by magic as part of its bite back. While Old Magic saved Harry, there's deeper magic behind it.
One reason why the Old Magic spell worked is because of Snape. Voldemort's betrayal of Snape's request to spare Lily represents a partial Old Magic spell. Rather, a betrayal would represent a typical ingredient to that sort of magic. Lily's spell of love actually integrates with the betrayal, and in effect Voldemort has invited his killing curse to blow back onto him. The betrayal is Voldemort accidentally casting a spell on himself, like adding an impurity to a potion by accident.
This all makes sense because Voldemort's reason for betraying Snape is due to his magical sociopathy in his master of magic folly. Desperation. You can see magic biting back in direct consequence to Voldemort's path.
However, this Old Magic incident doesn't defeat Voldemort, and ultimately he can overcome it with Harry's own blood. This is where Harry becomes part of magic's bite back not in an Old Magic sense, but in the deep magic.
Dumbledore figures out, rather immediately intuits the possibility that Harry is a Horcrux, and that Voldemort would probably be too arrogant to consider it. This makes Harry a key ingredient in the spell to take down Voldemort, in more ways than one. Dumbledore also clearly sees Snape's connection to this as well.
With Harry as the key ingredient, and his death a necessary part of the spell, Dumbledore has to take a special approach to Harry.
The seven Harry Potter novels and Harry's entire stay at Hogwarts, is a seven step spell cast by Dumbledore on Harry to prepare him for the killing blow on Voldemort.
Yes, each one of Harry's years was an advanced magic spell cast by Dumbledore to prepare Harry as one cures or refines potion ingredients. The Harry Potter years is the record of Dumbledore's one single great counter-curse.
This is why Dumbledore is both oddly aloof and simultaneously intricately involved in Harry's shenanigans. The clearest example of this is Fawkes the Phoenix. How did that work out? Dumbledore knew that Voldemort's echo and Harry-the-ingredient would magically, alchemically catalyze against each other. He knew that magic itself supported Harry. What Dumbledore needed to do was make sure Harry was prepared in the right way. He couldn't tell Harry what to do. Harry was being shaped by magic to serve his purpose in the spell.
Note that Fawkes was obtained by Dumbledore the same year Tom Riddle entered Hogwarts. I would entertain that Tom Riddle's connection to the Slytherin Basilisk is why the Phoenix core wand became his. Simultaneously, Tom's arrival at Hogwarts stirred the basilisk which has something to do with Fawkes becoming Dumbledore's companion.
Thus, Fawkes dying in front of Harry Potter was Fawkes's way of signaling what needed to happen. Note how Dumbledore downplayed the event. In reality, we should assume that Dumbledore had a much larger role in Fawkes coming to Harry than he later claims. At least in providing the bird the sorting hat, knowing that the Gryffindor sword might be needed to deal with the echo of Tom Riddle, if not the Basilisk.
We might even wonder if Dumbledore was the one who set in motion the invitation of dementors to Hogwarts. It seems like an extraordinary measure which he might have prevented. However, since year 3 was Harry's year to learn independence even from Dumbledore, due to the controversial situation of Sirius Black, the dementors became the perfect "ingredient" to hone Harry's lesson.
Etcetera.
In the final year, the legend of the Deathly Hallows is Dumbledore's final cast. After his own death. It was always Dumbledore's plan to "let" Malfoy beat him. Snape would have understood about the wand, since Snape's death was planned to fool Voldemort. This was a last, final element to the plan.
The three hallows actually form the core of the spell.
First, the invisibility cloak is essential in Harry's ability to properly do and learn what was needed in each year of school. James's possession of it, and Dumbledore's reflection on the question of death from the prophecy clued him into the hallows themselves as spell ingredients. Note that Harry receives the cloak from Dumbledore. One of the first movements of Dumbledore's spell that is kind of a backbone to Harry's activities.
Harry remarks that his extraordinary success is the result of help or luck, basically. He's a decent wizard but not a phenomenal talent. Think about how essential the invisibility cloak is as a leg up over other wizards who are not familiar with such a rare and capable artifact.
Next, the death stone permits Harry the courage to die. Simply that. It guarantees a face of stoicism that also bypasses Voldemort's skepticism. Had Harry suspected he would survive the ordeal, Voldemort might have thought twice and even figured out he was a horcrux. Had he worked that out, things could have gone very badly. Harry's resignation, and genuine belief in his own death, help convince Voldemort to destroy this hidden horcrux. The hallow becomes a key ingredient to deal with the trickiest horcrux. Imagine Voldemort whisking Harry away to distant safety where he'll never die nor ever be found.
Finally, the Elder Wand is the perfect Achilles' heel for Voldemort. Exploiting ambition and ironically turning it into doom.
In theory, other magical ingredients could have completed the spell. But the hallows effectively solve three unique problems, and together they represent mastery over death. Not a literal power over death, but here it resonates with the Trelawney prophecy. Both shall die, while one shall live again.
The key that turns it from a "either one or the other shall die" into "both shall die, while one shall live again" is mastery over death. In a figurative sense, the hallows represent a figurative power that transforms the meaning over the prophecy. Therefore, Dumbledore knew to use them to solve three specific problems to complete the overall spell. The rest of the spell was built around that.
Harry, and the hallows, were the core of Dumbledore's advanced, deep spell, which arose thanks to the hint of possibility given through the prophecy. Harry's years at Hogwarts became the effective spell, concluding with the final counter-curse which allowed magic to bite back at Voldemort without the world being destroyed in the process.
With this in mind, a lot of coincidences are explained. Harry's strong patronus ability is somewhat tied to the power of the deep magic spell resonating with normal magic. The coincidence of Harry's relationship with Malfoy culminating with his mother's intervention to lie to Voldemort about him being alive.
In my opinion, where people cite plot holes, or don't understand certain character behaviors or what the Deathly Hallows are, there is in fact a very consistent, well conceived magical architecture.
EDIT: So there's that theory that the hallows are all made from death-associated materials, like the cloak is made from the death veil at the MoM. That's reasonable and fits with the theory. The Peverells were still trying to answer the philosophical question of besting death (not immortality, but getting the upper hand on the pain/harm death causes), but they also experimented with death magic and incorporated it into their inventions. This makes sense, as it's very powerful magic, and would not be able to be wielded or applied without some sort of theory behind the intent. The cloak becomes this idea that the worst part of death is the mystery of it, not the thing itself, and so that's the power which becomes this ultimate upper hand on regular life. The wand is the idea that death is the ultimate power, the ultimate leveler. The stone is the idea that the worst part of death is what it sunders, not the loss of life itself inherent to death (that is, loss of life is inevitable, and the real problem is the separation). So in this way the hallows as objects made with death magic, but also reflecting on the riddle of death, become quite direct answers to the riddle, where the power of death and the problem of death are integrated into the objects themselves within some unified concept. And that's just good magic anyway. So, we can see the hallows as not merely answers to a philosophical question, but actually we can just ask, "Hey what sort of cool thing can you make with death magic?" And the philosophy becomes a starting point to explore magic at a theoretical level in trying to reckon what death magic is capable of.
We might assume the Peverells found access to some veil or some sort of portal to death. Maybe the MoM death veil was the Peverells' discovery. We can even imagining them studying the Thestrals (who are not related to death, but in a Darwinian sense adapted to their natural setting and found a way to exploit the thin veil of death for basic, useful invisibility), and then building a death veil using the results of their studies. They might have learned the arch is useless, since walking into it is a one way trip, but they still sought to make use of the discovery, hence the inventions. This could be the real event behind the figurative encounter with Death.
Given my opinion on theory of magic, if three researchers were trying to figure out how to use discoveries about death magic, they would have to formulate a philosophy which determines intent, and from there they can begin to innovate magic. So the question of besting death becomes a focal point for the brothers in approaching this task. We might take Dumbledore's side and assume that really they were just experimenting with magic, and trying to find some use for what they discovered. Yet, this desire to invent caused them to formulate their philosophical inquiry.