It's a war that Scotland (the country in which "Macbeth" is set, and of which Duncan is the king) is fighting against Norway. The battle is being fought in Fife, in Scotland, as the following speech of Ross' from Act 1, Scene 2 makes clear (I've highlighted the relevant bits for you!):
From Fife, great King,
Where the Norweyan banners flout the sky
And fan our people cold.
Norway himself, with terrible numbers,
Assisted by that most disloyal traitor
The Thane of Cawdor, began a dismal conflict,
Till that Bellona's bridegroom, lapp'd in proof,
Confronted him with self-comparisons,
Point against point rebellious, arm ’gainst arm,
Curbing his lavish spirit; and, to conclude,
The victory fell on us.
The battle is won thanks to the bravery of Macbeth and Banquo, though it was nearly lost because a traitor, the Thane of Cawdor, pretended to be on the Scottish side but was actually on the Norwegian side. The Thane of Cawdor gets caught and executed - and his title, as we know, gets given as a reward to Macbeth.
In this scene, Shakespeare reveals antecedent action involving Macbeth, Banquo, and the traitorous Macdonwald. In the passage, the term "sergeant" refers generally to an officer rather thana specific military rank. Througout the scene, Shakespeare refers to this officer as "Captain," which is a source of confusion for some readers.
The battle has occurred between King Duncan's forces and the armies of the King of Norway that have attacked Scotland. Macdonwald has joined forces against Duncan, bringing to the battle soldiers from Scotland's "Western Isles" as well as other soldiers. According to the captain, Macbeth fought his way through Macdonwald's forces until he faced Macdonwald himself and "unseamed him from the nave to th' chops, / And fixed his head upon our battlements."The captain continues that the king of Norway then mounted another ferocious attack, but that Macbeth, along with Banquo, "doubly redoubled strokes upon the foe," winning the battle.
A short time later, the Thane of Cawdor, another traitor, is captured and executed at King Duncan's order. Duncan rewards Macbeth for his courage and loyalty by giving him Cawdor's title and lands.