Shakespeare uses witchcraft for exposition and to increase the conflict in the story. Witchcraft is also used to set the mood of the story.
First of all, we learn more about what is going on through the witches. The witches tell us that there is a battle going on, and that they will meet again after the battle. Then, they greet Macbeth as Thane of Glamis and give him some future titles.
All hail, Macbeth! hail to thee, Thane of
All hail, Macbeth, that shalt be King hereafter! (Act I, Scene 3, enotes pdf p. 13)
This exchange both gives us more information and drives the plot along. It plants the seeds for Macbeth’s ambition, leading to the multitude of suspenseful and interesting conflicts of the play. Macbeth decides he wants to be king, because the witches told him.
[Aside.] The Prince of Cumberland! That is a step(55)
On which I must fall down, or else o'erleap,
For in my way it lies. Stars, hide your fires;
Let not light see my black and deep desires:
The eye wink at the hand; yet let that be
Which the eye fears, when it is done, to see.(60) (Act I, Scnene 3, p. 18)
This is the major problem of the play: Macbeth kills Duncan and becomes king, and the others have to stop him. This problem was created by witchcraft, because the witches shared their predictions with Macbeth and it became a self-fulfilling prophecy.
Witchcraft also imposes the dark and foreboding mood on the story.
There's husbandry in heaven,(5)
Their candles are all out. Take thee that too.
A heavy summons lies like lead upon me,
And yet I would not sleep. Merciful powers,
Restrain in me the cursed thoughts that nature
Gives way to in repose!(10) (Act 2, Scene 1, p. 20)
Horses devour each other, there is darkness and murder everywhere. This adds to the symbolic idea that the kingdom is rotting due to Macbeth’s rule.