Real World Background
Gawain is one of the leading knights of the Round Table in the Arthurian legend, at least as early as Geoffrey of Monmouth's History of the Kings of Britain. He was originally depicted as Arthur's greatest warrior, until Lancelot was introduced into the cycle and gradually deposed him.
According to Sir Thomas Malory's Le Morte d'Arthur, Gawain was the son of King Lot of Lothian and Orkney by Morgause, Arthur's half-sister (thus making him Arthur's nephew), and older brother to Agravain, Gaheris, Gareth, and Mordred (half-brother to the last). He was knighted on Arthur's wedding day, and undertook one of the first quests of his uncle's reign, when Arthur and Merlin sent him on a mission to recover a white stag that had ran through the great hall of Camelot during the first feast of the Round Table. Gawain tracked the white stag to the castle of a knight named Sir Ablamor in company with a pack of hounds, which pulled down the stag and slew it; Ablamor, furious at this act since the stag had been a gift from his lady, began killing the hounds in his anger. Protesting this act, Gawain challenged Ablamor to a duel and defeated him; Ablamor begged Gawain to spare him, but the young knight refused. As he brought his sword down for the beheading blow, Ablamor's lady threw herself in the way of his blade and was beheaded. Horrified at what he had done, Gawain submitted to the judgement of Arthur and Guinevere upon his return to court; Guinevere placed the penance upon him that he must always offer mercy to his opponents and aid any lady in distress thenceforth.
Gawain apparently retained some measure of vengefulness, though, since he also slew King Pellinore (who had slain Gawain's father, King Lot in battle) and his son Sir Lamorak (for having an affair with Gawain's mother Morgause). During the Quest of the Holy Grail, Gawain (who otherwise fared poorly on it because of his worldliness) also slew at least two other knights of the Round Table, his cousin Sir Uwaine les Avoutres and King Bagdemagus (though by mistake rather than intentionally).
When Agravain and Mordred planned to expose Lancelot and Guinevere's love affair, Gawain opposed their scheme and refused to take part in it. However, after Gaheris and Gareth were accidentally slain by Lancelot while he was rescuing Guinevere from being burnt at the stake, Gawain, filled with grief and vengeance, demanded that Arthur go to war with Lancelot; his anger kept the war going even after the Pope had intervened to demand that Lancelot return Guinevere to Arthur and Arthur agree to pardon her, leading to Arthur pursuing Lancelot abroad to France and leaving Mordred behind as Regent. Gawain challenged Lancelot to a series of duels, which always ended in Lancelot (after a hard battle) defeating Gawain, but sparing him since Lancelot remembered the friendship that had once existed between them. After word reached Arthur's camp of Mordred's rebellion, Gawain realized at last how his quest for revenge had helped destroy Camelot. He was mortally wounded in the first clash with Mordred's army at Dover and, dying, dictated a letter to Lancelot forgiving him and urging him to come to Arthur's aid. He died soon afterwards and was buried at Dover (according to Malory's publisher, William Caxton, his skull was on display there as late as the fifteenth century). The night before the Battle of Camlann, Gawain appeared to Arthur in a dream, urging him not to fight Mordred the following day, but delay long enough for Lancelot and his men to arrive; unfortunately, despite Gawain's warning, the battle still took place.
While Malory depicted Gawain in a largely unsympathetic light (except near the end, after his repentance), other interpretations of him in the Arthurian cycle portrayed him as a much nobler figure, particularly the fourteenth century English poem "Sir Gawain and the Green Knight", which told of his encounter with the Green Knight (see the entry on the Green Knight for the details). Roger Lancelyn Green in his twentieth century retelling of the Arthurian legend followed the older interpretation of Gawain's character, even giving him a partial success on the Quest for the Holy Grail (asking the question that would heal the wasteland around Carbonek); he also hinted that Gawain was Percival's father, a notion adopted by Greg Weisman.
Greg Weisman has stated that he thinks Gawain the best example of the Bastard archetype in the Arthurian legend - ironically, since Gawain was legitimate, leaving Greg to the speculation that the Bastard this time arranged to be born within wedlock to see if that would make any difference to his nature.