I know the tale of the three brothers, but does anyone know the true way of creation? I assume it was by Cadmus Peverell but how?
How was the stone created?
"Then the second brother, who was an arrogant man, decided that he wanted to humiliate Death still further, and asked for the power to recall others from Death. So Death picked up a stone from the riverbank and gave it to the second brother, and told him that the stone would have the power to bring back the dead."
Hermione reading the tale of the three brothers from the book "The Tales of Beedle the Bard" at Xenophilius Lovegood's house.
About the closest there is to the answer, from the canon Rowling has created thus far.
Dumbledore suggested Cadmus was just a very skilled wizard that could have created it himself, but again there is no detail describing how.
TL;DR - no canon answer but it is possible that a similar spell to the one that artists use to make portraits "alive" is also used by the stone to bring someone "back from the dead".
The most straight-forward answer would be - no canon answer.
However there is a similarity between how magical portraits are created and how the Resurrection Stone works.
Here is what Pottermore says about portraits:
When a magical portrait is taken, the witch or wizard artist will naturally use enchantments to ensure that the painting will be able to move in the usual way. The portrait will be able to use some of the subject’s favourite phrases and imitate their general demeanour.
However, neither of these portraits would be capable of having a particularly in-depth discussion about more complex aspects of their lives: they are literally and metaphorically two-dimensional. They are only representations of the living subjects as seen by the artist.
Compare this to the description of the person returned back by the Resurrection Stone (The Tales of Beedle the Bard - The Tale of the Three Brothers):
Yet she was silent and cold, separated from him as though by a veil. Though she had returned to the mortal world, she did not truly belong there and suffered.
As portraits represent the depicted person through the eyes of the artist, so the stone returns a shade/ghost of the dead person, as the stone user remembers.
Why does it not work so well?
People are ... complicated. Creating a personality based on a single person's memories impossible even by using magic. In the end you will get exactly what the Resurrection Stone does - a shallow copy.