No historical or literary prototype is known for Lancelot, unlike many of the other knights, who come from Celtic or European myth or legend, or can be traced to literary analogues of notable figures (or figures whom later writers felt ought to have been notable).
Lancelot appears to have been introduced for two reasons: to allow a French flavour into Arthur's court (many of the earlier stories feature Arthur fighting against French kings, often because they had usurped the throne from a more rightful occupant), and to provide a second romantic triangle, as a mirror to the Tristram and Ysolde and King Mark stories.
Chretien de Troyes introduces Lancelot in Erec and Enide, as the third most renowned knight (after Gawain and Erec), but he does not get a "starring" role until the same author's Le Chevalier de le Charette. At this time his lineage is not expounded. This is left to a Swiss/German poet, Ulrich von Zatzikhoven, who (in Lanzelet) had him abducted at the ago of 2 and raised by a water-sprite. Thereafter he conventionally becomes "Lancelot du Lac" and his early championing of Arthur's wife Guinevere, is transformed into illicit love and finally (as the age of high chivalry faded and noble men were no longer expected merely to love their ladies from afar) into adultery.
This adulterous relationship then became the seed for the traditional dusk of Arthur's reign. With it doscivered the king is forced to condemn his wife to death; Lancelot saves her, and in doing so, kills other knights, a blood-feud ensues, and Lancelot returns to France. Arthur follows and in his absence his own illegitimate son, Mordred, seizes the throne and Guinevere, precipitating the battle of Camlann, in which both men die. Lancelot, broken, retires to a monastery.
In the interim, Lancelot had also become the "finest" of Arthur's knights, had produced a son, Galahad, had essayed the Grail (but failed because of his sin with Guinevere), and had then been redeemed by repentance and allowed to cure a wounded knight who could only be cured by the best knight in the world. Galahad would, of course, go on to achieve the Grail and depart the mortal world with it.