At the beginning of Scene 3 in Act 5, Macbeth seems full of confidence. He makes what appears to be a general announcement beginning with these words:
Bring me no more reports. Let them fly all.
Till Birnam Wood remove to Dunsinane,
I cannot taint with fear. What's the boy Malcolm?
Was he not born of woman?
He is reminding himself of the two assurances he was given by the apparitions raised by the three witches in Act 4, Scene 1. Then at the beginning of Scene 5 in Act 5, Macbeth is still full of confidence. In the opening lines he says:
Our castle's strength
Will laugh a siege to scorn. Here let them lie
Till famine and the ague eat them up.
But shortly later in that same scene a Messenger comes to make the following announcement, knowing that it will anger Macbeth and fearing to utter the words.
As I did stand my watch upon the hill,
I looked toward Birnam, and anon methought
The wood began to move.
Macbeth is aghast, not only because it means the approach of a large English army but because it causes him to realize that the apparitions' assurances may have been ambiguous and intentionally misleading. This would mean that he can't trust anybody, not even the evil supernatural forces to whom it would seem he has sold his soul. He tells himself:
I pull in resolution, and begin
To doubt th' equivocation of the fiend
That lies like truth.
This is when Macbeth knows he is in trouble. He reminds himself that he was told not to be afraid until Birnam Wood comes to Dunsinane. But it would seem that the apparition was advising him that it would be time to start being frightened when that happened.
"Fear not, till Birnam Wood
Do come to Dunsinane," and now a wood
Comes toward Dunsinane."
The wood is moving, of course, because in Act 5, Scene 4, Malcolm had ordered every soldier in his army to cut down a tree branch and carry it upright in front of him. This would have made a strange spectacle. Malcolm gave that order, as he says, because
There shall we shadow
The numbers of our host and make discovery
Lie in report of us.
It would seem that with all those tree branches moving with the marching soldiers, it would look like a bigger army approaching. Macbeth may have gotten the impression that the trees themselves are moving and not just the branches. That would suggest that a truly powerful army had uprooted the entire forest and was carrying them toward his castle--perhaps to use them as battering rams, not only against the gates, but to batter down the stone walls and utterly demolish his stronghold. Macbeth had been planning to remain inside his castle and withstand a siege, but the thought that he had a bigger army to contend with than he had expected makes him decide to lead his remaining troops out to fight the enemy in the field. He no longer believes he can withstand a siege if the invaders are that formidable. He is losing adherents all the time, and he decides that his best hope, albeit a feeble one, is to go out and fight. No doubt he thinks that the sight of a moving forest approaching the castle would cause many more of his soldiers to lose heart and flee for their lives.
Macbeth's troubles keep growing, but he clings to the belief that no man of woman born can overcome him. Then he meets Macduff on the battlefield in Act 5, Scene 8, and is told:
Despair thy charm,
And let the angel whom thou still hast served
Tell thee Macduff was from his mother's womb
This makes Macbeth lose the last of his confidence. He doesn't want to fight because he senses he is doomed; but he is forced to do so because Macduff threatens to have him put on display in a cage if he lets himself be taken prisoner. So Macbeth goes down fighting. At least he remains a hero in that respect.