Shakespeare's Macbeth (ca. 1606), like King Lear and parts of Cymbeline, seems to have been based in part on Raphael Holinshed's Chronicles of Englande, Scotlande, and Ireland (1577 and 1586). Holinshed very likely wrote most of the history of England himself but cobbled together the Scottish history from notes left by a printer named Reginald Wolfe and a history of Scotland written in Latin by Hector Boece.
Several important elements in Macbeth--for example, the three witches and their prophecy and the killing of King Duncan--are from incidents recounted in Holinshed's Chronicles:
. . . there they [Macbeth and Banquo] met them three women in strange and wild apparell, resembling creatures of elder world. . . . The second of them said, 'Haile Makbeth thane of Cawdor.' But the third said, 'All haile Makbeth that hereafter shalt be king of Scotland.' (Vol. V, Scotland, p. 268).
This sets the stage (no pun intended) for Macbeth to begin thinking about his potential kingship--despite the fact that Duncan is in good health, his rightful king, and his kinsman.
Although Shakespeare deviated quite a bit from Holinshed in the play's handling of many events, the witch incident, which begins Macbeth's serious consideration of his own ability to rule Scotland better than Duncan, is very close to Holinshed's account. Banquo's fate in the play, too, is very close to Holinshed's historical account. When Banquo, for example, asks the witches if they have anything good in store for him, they reply
. . . we promise greater benefits unto thee, than unto him, for he shall reigne in deed, but with an unluckie end. . . .
They promise that although Banquo will not be king "but of thee those shall be borne which shall governe the Scotish kingdome by long order of continuall descent." In other words, Banquo will achieve the goal of any nobleman during the early feudal period--the creation of a ruling dynasty.
Shakespeare may not have followed Holinshed's history closely, but his critical use of the meeting with the witches, which follows Holinshed's version precisely, establishes a) that Macbeth will become king but end unhappily and b) that Banquo, not Macbeth, will become the founder of Scotland's rulers.