At the end of act 3, scene 4 of William Shakespeare's Macbeth, in which the ghost of the murdered Banquo appears to Macbeth at his coronation banquet, the unnerved Macbeth decides to visit the witches who first prophesied that he would be thane of Glamis, thane of Cawdor, and "shalt be King hereafter!" (act 1, scene 3, line 53). Macbeth is determined to find out what the future holds for him, no matter the consequences.
MACBETH. I will tomorrow,
And betimes I will, to the weird sisters.
More shall they speak; for now I am bent to know,
By the worst means, the worst.
(act 3, scene 4, lines 161–164)
Macbeth further emphasizes this in act 4, scene 1 when he demands that the witches answer his questions.
MACBETH. Even till destruction sicken, answer me
To what I ask you.
(act 4, scene 1, lines 61–62)
The witches agree to tell Macbeth they know, and after some witchy mumbo jumbo, they turn over the apparition duties to their "masters," who know Macbeth's questions even before he asks them.
FIRST WITCH. He knows thy thought:
Hear his speech, but say thou nought.
(act 4, scene 1, lines 76–77)
The first apparition is an "Armed [helmeted] Head." It tells Macbeth, "Beware Macduff; / Beware the Thane of Fife" (act 4, scene 1, lines 78–80). Macbeth replies, somewhat sarcastically, that he already knows that "thou has harp'd my fear aright," and the apparition disappears before Macbeth can ask it anything else.
The second apparition is "a Bloody Child," which is wholly disconcerting, but the child is bloody from childbirth, not from injury. Equally unsettling, though, is that the child speaks to Macbeth in its own voice and tells him that "none of woman born / Shall harm Macbeth" (act 4, scene 1, lines 89–90).
This relieves Macbeth's fear of Macduff to a certain extent, but just to be rid of his fear for certain, Macbeth, ever cautious, particularly where the security of his head and crown are concerned, decides to kill Macduff anyway.
MACBETH. But yet I'll make assurance double sure,
And take a bond of fate: thou shalt not live.
(act 4, scene 1, lines 92–93)
The third apparition, another child, this one wearing a crown and holding a tree branch in its hand, tells Macbeth in its child's voice,
Macbeth shall never vanquish’d be until
Great Birnam Wood to high Dunsinane Hill
Shall come against him.
(act 4, scene 1, lines 103–105)
Macbeth is very happy to hear this and remarks to the witches that he has absolutely nothing to fear from Macduff or his army.
MACBETH. That will never be.
Who can impress the forest, bid the tree
Unfix his earth-bound root?
(act 4, scene 1, lines 106–108)
As far as the witches are concerned, the show is over—"seek to know no more"—but Macbeth insists that the witches answer one more question.
MACBETH. Yet my heart
Throbs to know one thing: tell me, if your art
Can tell so much, shall Banquo's issue [descendants] ever
Reign in this kingdom?
(act 4, scene 1, lines 112–115)
Macbeth, apparently thinking that he actually has power over the witches, threatens "an eternal curse" on them if they don't answer the question about Banquo's descendants.
The witches humor Macbeth and produce a fourth apparition, "a show of eight Kings, and Banquo last with a glass in his hand," which demonstrates the prophecy made to Banquo in act 1, scene 3: "Thou shalt get [beget] kings, though thou be none."
All of the eight kings in the parade look like Banquo, and Banquo himself holds up a mirror so that Macbeth can see Banquo's descendants reflected "out to the crack of doom," in other words, "to infinity and beyond."
This is not something that Macbeth is pleased to see. Just to be sure, though, he ask the witches if this apparition is true, and a witch responds, "Ay, sir, all this is so" (act 4, scene 1, lines 138).
The witches close out the apparition show with a short dance and then disappear.
The first three apparitions, as well as many other elements of the plot of Macbeth, are drawn from Raphael Holinshed's Chronicles of England, Scotland and Ireland, which Shakespeare used as a source for many other of his historical plays.
The fourth apparition, however, the parade of kings, is entirely Shakespeare's invention.
Shakespeare scholars are fairly certain that Shakespeare wrote Macbeth for King James I, who ascended to the throne of England after the death of Queen Elizabeth I in 1603. Before he became King James I of England, James was King James VI of Scotland. As James I, he ruled both England and Scotland. This is James I's "Scottish connection" to Macbeth.
James was very much interested in witches and witchcraft, and he was notorious in Scotland as a zealous—some would say, fanatically obsessed—"witch hunter." He personally supervised the interrogation of suspected witches, and he attended witch burnings.
James also wrote a book on the subject of witchcraft, usually simply referred to as Daemonologie. This is James I's "witch connection" to Macbeth.
James I also believed that he was descended from Banquo. The eight kings that appear to Macbeth in the fourth apparition represent the line of kings from Banquo to James I. Macbeth's mention of "two-fold balls and treble sceptre" refers to James I's double coronation at Scone, in Scotland, and at Westminster in London. These are James I's "Banquo connections" to Macbeth.
There's no evidence whatsoever to support James's contention that he was descended from Banquo, but James wasn't particularly interested in the facts of the matter, which are that Banquo's son, Fleance, didn't become king at Macbeth's death and neither did any other of Banquo's descendants. When Macbeth died, the throne of Scotland passed instead to Macbeth's stepson, Lulach—Lady Macbeth's son by a previous marriage—and Lulach ruled for about eight months before he was killed by King Duncan's son, Malcolm. The line of kings of Scotland descends from Duncan, with a quick sidestep through Lulach, not from Banquo.
Aside from all that, Banquo probably never existed. Banquo is part of Scottish legend that Holinshed included in his Chronicles (volume 5). After excluding the part in the Chronicles where Banquo assists Macbeth in murdering King Duncan, which wouldn't reflect very well on Banquo or James I, Shakespeare includes Banquo in his play as a foil to Macbeth and to gratify King James I.
By the time Shakespeare wrote Macbeth, Shakespeare's acting company, The Lord Chamberlain's Men, had come under the patronage of James I and been renamed "The King's Men." This is James I's "Shakespeare connection" to Macbeth, and it's likely the reason that Shakespeare wrote Macbeth for James I.
On August 7, 1606, the first performance of Macbeth was given in the Great Hall of Hampton Court Palace in London for King James I and his brother-in-law, King Christian IV of Denmark, as recorded in the "Account of the Revels at Court," which notes that Shakespeare's acting company, The King's Men, performed three plays for the Kings James I and Christian IV during Christian's visit to England from July 18 to August 10.