If this is in reference to the apparition of Banquo in Act 3, Scene 4, we can argue that this hallucination is the result of Macbeth's guilty conscience playing tricks on his senses. Having ordered Banquo's death, Macbeth's anxiety reaches a tipping point and he begins hallucinating that Banquo is at the banquet. Lady Macbeth excuses him, saying this is a common but temporary episode that has existed since Macbeth's youth. Clearly, the apparition of Banquo haunting Macbeth reflects Macbeth's own thoughts of guilt and anxiety.
This is likely in reference to the apparitions the Witches summon to predict Macbeth's future. The first apparition tells Macbeth to beware of Macduff. Macduff is allied with Malcolm, the rightful heir to the throne. So, Macduff is a threat. Therefore, this apparition could be a reflection of Macbeth's fear of Macduff as well as a prediction of the future. The second apparition of the bloody child that states no man of woman born can harm Macbeth is a bit too cryptic to indicate any connection with Macbeth's prior fears or aspirations about his future. The third apparition tells Macbeth that "Macbeth shall never vanquish'd be until / Great Birnam Wood to high Dunsinane Hill / Shall come against him. (IV.i.103-105) This is also like a riddle and as anxious as Macbeth is of any threat, he dismisses the idea of a forest marching on his castle as ludicrous. At this point, Macbeth is being given a false sense of invincibility. But he does still have fear.
Macbeth is obviously disturbed by the image of Banquo in the final prediction. And this guilt of having killed Banquo and fear of his descendants occupying the throne has continued since Act 3. But Macbeth first concentrates his efforts and getting rid of the first apparition's threat: Macduff.
Macbeth knew that though he would be the king, his heirs would never ascend the throne. It would be Banquo's children who would rule England. The apparitions of Banquo and his heirs walking past him in a never ending line, not only confirmed the witches' prophecy but also proved that he saw what was foremost on his mind.
The apparitions disturbed Macbeth and made him lose his confident.