"The worst sort of wolves are hairy on the inside..." - Angela Carter, "The Company of Wolves"
Fairytales, as we know them today, hit their stride as a genre at the French court in the 17th century, coinciding roughly with the Maunder Miminum - a period within the Little Ice Age when sunspot activity pushed European temperatures to the coldest they have been in recorded history. As this is also an era when werewolves are often put on trial in France, and when German superstition holds that charms may be bought to repel wolf attacks, perhaps it is no surprise that one of the most famous and memorable folkloric villains to come out of the fairytale tradition is the Big Bad Wolf.
Little Red Riding Hood, in the earliest known versions of her story (which some sources suggest may go back to the eleventh century, and certainly exist by the sixteenth), meets a werewolf or an ogre on the road; the fact that he is a wolf and not explicitly stated to be a werewolf as well seems to come to us from Charles Perrault. (The red hood, from which modern versions of the tale take their title, is also introduced in his version.) Still, she reacts as though she had met a man whose suggestion that she take a shortcut is one that can be trusted.
Pre-Perrault versions of the story also tend to include the wolf carving up the grandmother and serving the meat to Red, and sometimes taking advantage of Red sexually as well before eating her. Although some versions do have the girl making her escape without assistance, the huntsman rescuer is nowhere to be found. (He is introduced by the Grimms, who seem to have borrowed the motif from another tale entirely, that of the Wolf and the Seven Young Goats.)
In her modern adaptation of the story, "The Company of Wolves," Angela Carter makes the Big Bad Wolf a werewolf, showing his true form to the girl only after he has her in his power. This, in fact, accords with many prior versions of the tale.
Perrault's moral, that when we go astray we might become dinner for wolves, is often interpreted as a symbolic warning of "stranger danger," especially with the emphasis on girls as the victims. But this may be a mistaken projection into the past of the idea that there are child predators lurking around every corner, a modern fear which seems not to have been especially prevalent prior to the twentieth century. More likely, Perrault means his moral quite literally - stick to paths you know to be safe, because there are actual hungry wolves and other dangers in the wild woods that can easily cause harm, especially to children.
The story of the Three Little Pigs, which features a similar antagonist, does not seem to predate by very many years the Grimm Brothers' collection of it in the early 1840s. Again the story seems to have been inspired by that of the Seven Young Goats, but it makes a much better tale than this antecedent. It has certainly helped, however, with cementing the character in the popular imagination; we now also see him in the musical Into the Woods, as the gruff sheriff of the Fables, and in many other pop-culture adaptations. The theme for which he stands seems to remain fairly consistent, however - he is the danger that lurks just off the safe paths, the dog that haunts the roadways when your trail takes you away from the safety of home.