In Macbeth, the setting varies throughout the play. Though most scenarios take place in different Scottish locations, Inverness, Forres and Fife, the play also happens in England.
Macbeth was meant to be a warning to any traitors with the idea of overthrowing the king.
Shakespeare wrote the play to please and flatter the king in many ways
King James symbolised the union of the Scottish and English crowns, a union which Shakespeare refers in the play. The King was being persecuted by many and his crown was in danger.
Macbeth's storyline is partly built on fact. Macbeth was a real Scottish king who reigned in Scotland from 1040 to 1057. His predecessor, Duncan, was defeated by Macbeth himself in battle. However, the real Duncan was feeble and a man near Macbeth's age, not the reputable and elderly character portrayed in Shakespeare's work. In truth, Macbeth was succeeded by his stepson, not by Duncan's son.
Shakespeare got inspiration of his version of Macbeth in the Chronicles of Holinshed, a historian of his time.
Great Chain Of Being
In the middle ages religious thinkers relied on the belief that both nature and humankind had a designated a place in the world and the alteration of anyone's position would signify a great offence against God. As royal rank was acknowledged as sacred and bestowed by God, it was considered a sin to aspire to it. Macbeth was meant to be a warning to anyone who attempted to bring down the king.
Shakespeare introduces in Macbeth the popular beliefs of his time about witches and witchcraft. Witches were linked to darkness and death. When the play was written, witchcraft was a subject of increasing interest among the population. Witches were said to be able to perform all the kind of deeds Shakespeare depicts in his work. For a king like Macbeth to visit and have dealings with witches would have seemed as both a crime and a sin.