Banquo acts as a foil or contrast to Macbeth. Banquo and Macbeth are good friends and fearless leaders who fight valiantly to defend Duncan from a would-be usurper of his throne. Together, the two hear the witches' prophesies that Macbeth will be king of Scotland and that Banquo's descendants will also become kings of Scotland.
Like Macbeth, Banquo has "cursed thoughts" about killing Duncan. However, Banquo differs from Macbeth in that he has enough moral conscience not to act on his evil impulses. Against the background of Banquo, who is willing to let events take their own course, Macbeth's (and Lady Macbeth's) ruthless ambitions are highlighted.
Banquo shows the other path Macbeth could have taken: the path of patiently waiting for the prophesies to unfold.
It is worth noting that Banquo's death is the final time that Macbeth shows a conscience. Having his friend murdered troubles him greatly, so much so that he either sees, or imagines he sees, Banquo's ghost at a banquet. But once he is over Banquo's death, Macbeth is largely hardened. It is as if once he loses his friend, Macbeth is also lost.