Like Thor and Odin, Loki originated in Norse mythology, where they were all major pre-Christian deities of the Scandinavian people. Where as most Norse gods were big burly guys with long beards, Loki was always portrayed as lithe, androgynous, and sneaky. Although he was the child of Frost Giants, he was associated with fire and the color red. Like fire, he could not be easily contained and never kept to just one shape. He and Odin, king of the gods, were blood brothers, which made him basically a member of the family no matter how much trouble he caused. And as the god of mischief, he caused no end of trouble.
He also produced monstrous children, who had their own roles to play in the mythology. He was the father of Hel, the half-withered goddess of the underworld, and of Fenrir, the giant Wolf who bit the hand off of the god Tyr. Having once taken the form of a mare, he was the mother of Odin’s eight-legged horse, Sleipnir.
As a prank, Loki once cut all of the hair off of Thor’s wife Sif. When he got in trouble for it, he made amends by giving Sif new hair spun of gold, and also commissioning the dwarves to forge Thor’s famous hammer, Mjolnir. When Loki proved too troublesome, Odin bound him under the Earth, where a serpent constantly drips poison on his face. He’ll be released with the coming of Ragnarok, the Norse apocalypse, in which all the gods and monsters will fight to the death.