HG Wells claimed in his autobiography that he and Joseph Conrad had "never really 'got on'", but you wouldn't suspect that from the gushing fan letter Conrad sent to Wells, eight years his junior but far more established as a writer, in 1897. Before their friendship soured, Conrad idolised him, and he wrote to rhapsodise the author of scientific romances as a "Realist of the Fantastic". It's a perceptive formula, capturing Wells's blend of wild invention and social realism: tea and cakes and time machines. That attitude is nowhere more evident than in the book that elicited Conrad's letter: The Invisible Man.

To judge from Wells's own account of his objectives, Conrad had divined them perfectly. "For the writer of fantastic stories to help the reader to play the game properly," Wells wrote in 1934, "he must help him in every possible unobtrusive way to domesticate the impossible hypothesis … instead of the usual interview with the devil or a magician, an ingenious use of scientific patter might with advantage be substituted. I simply brought the fetish stuff up to date, and made it as near actual theory as possible."

In other words, Wells wanted to turn myth into science, or at least something that would pass for it. This is why The Invisible Man is so useful for interpreting the claims of modern physicists and engineers to be making what they call "invisibility cloaks": physical structures that try to hide from sight both themselves and what lies behind them. It's tempting to suggest that, as with atomic bombs, Wells's imagination was anticipating what science would later realise. But the light that his invisible man casts on today's technological magic is much more revealing.

Wells may well have set out explicitly to update a myth. One of the earliest stories about invisibility appears near the start of Plato's Republic, a book that had impressed Wells in his youth. Plato's narrator, Glaucon, tells of a Lydian shepherd named Gyges who discovered a ring of invisibility in the bowels of the Earth. Without further ado, Gyges used this power to seduce the queen, kill the king and establish a new dynasty of Lydian rulers. In a single sentence Plato tells us what many subsequent stories of invisibility would reiterate at length about the desires that the dream of invisibility feeds: they are about sex, wealth and death.

Evidently this power corrupts – which is one reason why Tolkien's use of invisibility magic is much more mythically valid than JK Rowling's. But Glaucon's point has nothing to do with invisibility itself. It is about moral responsibility. Given this power to pass unseen, he says, no one "would be so incorruptible that he would stay on the path of justice, when he could with impunity take whatever he wanted from the market, go into houses and have sexual relations with anyone he wanted, kill anyone, and do the other things that would make him like a god among men". The challenge is how to keep rulers just if they can keep their injustices hidden.

We don't need an explanation of where Gyges's ring comes from or how it works, because its function is metaphorical. The same is true of magic in fairytales: it just happens, because it is not about the doing but the consequences. Fairytale invisibility is often an agency of seduction and voyeurism (see the Grimms' The Twelve Dancing Princesses), or a gateway to Faerie and other liminal realms. It's precisely because children don't ask "How is that possible?" that we shouldn't fret about filling their heads with such allegedly irrational ideas.

But it is a peculiarity of our age that we focus on the means of making magic and not on the motive. The value of The Invisible Man is that it highlights the messy outcome of this collision between science and myth. True, Wells makes some attempt to convince us that his antihero, Griffin, is corrupted by discovering the "secret of invisibility" – but it is a weakness of the novel that Griffin scarcely has any distance to fall, since he is thoroughly obnoxious from the outset, driving his poor father to suicide by swindling him out of money he doesn't possess in order to fund his lone research. If we are meant to laugh at the superstitions of the bucolic villages of Iping as the unseen Griffin rains blows on them, I for one root for the bumpkins.

No, where the book both impresses and exposes is in its description of how Griffin becomes invisible. A plausible account of that trick had been attempted before, for example in Edward Page Mitchell's 1881 short story "The Crystal Man", but Wells had enough scientific nous to make it convincing. While Mitchell's scientist simply makes his body transparent, Wells knew that it was necessary not just to eliminate pigmentation (which Griffin achieves chemically), but to eliminate refraction, too: the bending of light that we see through glass or water. There was no known way of doing that, and Wells was forced to resort to the kind of "jiggery-pokery magic" he had criticised in Mary Shelley's Frankenstein. He exploited the very recent discovery of x-rays by saying that Griffin had discovered a related form of "ethereal vibration" that gives materials the same refractive strength as air.

Despite this, Griffin finds that invisibility is more a burden than a liberation. He dreams of world domination but, forgetting to vanish his clothes too, has to wander naked in the winter streets of London, bruised by unseeing crowds and frightened that he will be revealed by the snow that threatens to settle on his body and record his footsteps. His eventual demise has no real tragedy in it, but is like the lynching of a common criminal, betrayed by sneezes, sore feet and his digestive tract (in which food visibly lingers for a time). Thus Wells shows us what it means to domesticate the impossible, and what we should expect when science tries to do magic.

That same gap between principle and practice hangs over today's "invisibility cloaks". They work in a different, and technologically marvelous, way: not by transparency, but by guiding light around the object they hide. But when the first was unveiled in 2006, it was perplexing: for there it sat, several concentric rings of printed circuit boards, as visible as you or me. It was, the scientists explained, invisible to microwaves, not to visible light. What had this to do with Gyges, or even with Griffin?

Some scientists say that, for all their technical brilliance (which is considerable, and improving steadily), these constructs should be regarded as clever optical devices, not invisibility cloaks. It's hard to imagine how they could ever conceal a person walking around in daylight. This "magic" is cumbersome and compromised: it is not the way to seduce the queen, kill the king and become a tyrant.

This isn't to disparage the invention and imagination that today's "invisibility cloaks" embody. But it's a reminder that myth is not a technical challenge, not a blueprint for the engineer. It's about us, and all our desires, flaws and dreams.