I don't believe I had heard of this particular fairytale before this episode, which is odd, because I was pretty sure I had read all of the Grimm stories a long time ago. Even some of the more obscure ones, like
The Girl Without Hands sparked recognition after Grimm went over the story in the Light Theater, but even after playing through this particular tale, I find that I don't recall it. That being said, I'm not doubting the story's origin by any means, especially since it has a very unique Brothers Grimm feel to it.
You see, in The Devil and His Three Golden Hairs, a boy is born in a peculiar manner (the exact details are something I will not go into on this family-friendly website), the midwife prophesizes that this is an omen and the boy will grow up to marry the King's daughter. When the King hears of this, he buys the boy for one gold coin, and sets him on the river to die.
But, of course, the tale doesn't end here; a miller finds the baby and raises him as his own. When the King comes upon the kid, he recognizes him (exactly how, I can't say because pretty much everyone looks the same as a newborn), and asks the miller if the boy is his natural son. When the man says that he found him on the river, and that the boy has extreme luck, the King knows it is the person he tried to get rid of all those years ago.
Not wanting his daughter wed, he sends the boy to deliver a letter to the Queen; what the boy doesn't realize is that the letter orders his beheading. Well, like I said, this kid's luck is extraordinary, because he gets lost and decides to sleep in a camp owned by thieves, but instead of killing him on sight, they decide to read the letter and, in an effort to defy the King, change it to have the King give the boy to the princess.
To make the story more convoluted (as these tend to be), when the King arrives at the castle to find that the boy is going to become his son-in-law, he tells him that he won't be able to unless he retrieves the three golden hairs that are on The Devil's head. So the boy makes his way to the underworld, and upon arriving at Lucifer's abode, he runs into the horned-one's grandmother (don't ask, just accept it), and she decides to help the boy. She turns him into an ant, and slips him into her clothes while she talks to The Devil and gets him to take a nap. While resting, she plucks the three hairs and sends the boy on his way.
When looking at this story, it's easy to see why this isn't one of the ones that made it into a Disney movie, and Grimm also sees the many flaws in the tale. That's why he wants to show the boy why you shouldn't go through life relying on the kindness of strangers and haphazard luck.