Shakespeare does not provide us, the audience, with just one simple end to the play, but also resolves certain issues that some of the characters have had before finally closing the curtain.
The first of these is the answer to one of the witches' predictions about Macbeth's invincibility and also the paradoxical nature of their forecasts. In his final confrontation with Macduff, Macbeth warns him that:
"I bear a charmed life, which must not yield,
To one of woman born."
Macbeth still believes that he cannot be defeated by anyone (of woman born). Macduff responds:
"Despair thy charm;
And let the angel whom thou still hast served
Tell thee, Macduff was from his mother's womb
He tells Macbeth that he was not naturally born, but had been cut out of his mother's womb before the due date. Macbeth now realizes that he had been deceived and cries out:
"Accursed be that tongue that tells me so,
For it hath cow'd my better part of man!
And be these juggling fiends no more believed,"
He feels that he had been made a fool of and curses the witches for misleading him. The two men fight and Macbeth is killed.
An issue is also resolved for Siward. He is concerned about his son who is missing and is informed that he had died a hero. In this instance, the audience is made aware of the great sacrifices made by so many innocents who bravely fought Macbeth's tyranny.
Macduff enters, bearing Macbeth's head and greets Malcolm:
"Hail, king! for so thou art: behold, where stands
The usurper's cursed head: the time is free:"
With Macbeth's death, Scotland's problems have been resolved and they are once again free. Macduff says that he is expressing the sentiments of all present by greeting Malcolm thus. On this, the other men also hail Malcolm as the new king of Scotland.
Malcolm rewards all the thanes and other kinsmen present with the titles of earls and promises to reward others for their love and loyalty. He thanks all for their contributions and makes reference to lady Macbeth who
"by self and violent hands
Took off her life;"
She has committed suicide, resolving another issue regarding her untimely death. Malcolm then promises a more peaceful and prosperous future for Scotland and lastly, invites all to his crowning at Scone, his castle.
The play ends with Malcolm giving a speech in which he promises to be a good king to all the people of Scotland. He invites them to come and attend his coronation at Scone, the traditional place for Scottish kings to be crowned.
Just before he gives this speech, he has been brought the severed head of Macbeth by Macduff, who killed Macbeth.
So the play resolves with Macbeth getting what he deserves and peace and order being returned to Scotland.
This brings us full circle to the beginning of the play -- there, Macbeth was risking his life defending the king of Scotland. Here, he is dying so that the rightful king can have the throne.