Both Macbeth and Lady Macbeth were actual figures in Scottish history. Macbeth ruled from 1040-1057 and seems to have been regarded as a relatively good king. He did kill the previous king, Duncan, in battle in order to take the throne — but that was standard practice for pretty much every Scottish king of the time, including Duncan. And Macbeth is often credited with bringing a measure of stability and prosperity to Scotland. As proof of this, he was able to go on a pilgrimage to Rome in 1050, where he "scattered money like seed to the poor."
We're not aware of any contemporary images of the historical Macbeth, but this image shows the coronation of a Scottish king not too long after Macbeth lived:
Note the royal poet on the left, reciting a proclamation to the king and wearing an early form of a kilt!
Lady Macbeth, whose name was Gruoch, was an important woman in Scottish history. Her first husband was killed by Macbeth, who then married her and became stepfather to her son from that first marriage. Both Macbeth and Gruoch were descended separately from different Scottish kings, so their marriage brought together multiple claims to the Scottish throne, making Macbeth a more legitimate king than Duncan had been.
Shakespeare probably knew very little in the way of actual facts about the life of the historical Macbeth. He borrowed the story of Macbeth from one of his favorite sources, Holinshed's Chronicles, the first history of the British Isles published in English. Holinshed's narrative is far from being an accurate history as we would think of it today. It's more along the lines of what we might call historical fiction: entertaining stories that draw on history for their material but embellish and fill in gaps as needed.
The plot of Macbeth combines elements from two different stories found in Holinshed. In the first, a man named Donwald finds several of his family put to death by his king, King Duff, for dealing with witches. After being pressured by his wife, he and four of his servants kill the King while he is a guest in Donwald's castle. The circumstances of the murder have many similarities to those in Shakespeare's play.
The actual story of Macbeth comes later in the Chronicles: the thane Macbeth is portrayed as struggling to defend the kingdom in the face of King Duncan's ineptitude. He and Banquo meet the three witches, who make exactly the same prophecies as in Shakespeare's version. Holinshed's text includes this woodcut depicting the meeting:
Macbeth and Banquo then plot the murder of Duncan together, at Lady Macbeth's urging. Duncan is killed in an ambush, however, not in Macbeth's own castle. Macbeth has a long reign before eventually being overthrown by Macduff and Malcolm.
By combining the story of Macbeth with the type of murder committed by Donwald, Shakespeare adds to the darkness of Macbeth's crime as the worst violation of hospitality. But he also creates greater opportunity for exploring the psychology of his main characters. (Dramaturgical notes by Karen Gellman.)