It is assumed that the battle occurred during Act I, Scene 1. We don’t get the full story of what happens in the battle until Act 1, Scene 2, 3 and 4. The reason Duncan proclaims Macbeth the new Thane of Cawdor is because the former Thane of Cawdor performed some act of treachery or treason during the battle. Duncan promptly orders the Thane of Cawdor’s execution. Duncan says:
No more that Thane of Cawdor shall deceive
Our bosom interest: go pronounce his death,
And with this former title greet Macbeth (1.1.63-65).
Despite the Thane of Cawdor’s treason, Macbeth led the Scottish forces to victory over Macdonwald and the Norwegians.
In Act 1, Scene 4, Malcolm informs Duncan that the former Thane of Cawdor has been executed. Prior to the execution, the Thane confessed and asked forgiveness. Duncan regrets having ordered the execution. But Duncan is comforted that Macbeth, who up to this point has been loyal and a worthy soldier, is taking over Cawdor.