both armies; both forces
Refers to two opposing military forces or armies in a conflict.
Both armies fought fiercely.
Both teams will face off in the final match.
both teams; both sides
Extended to sports, games, debates, or any competitive context with two opposing sides.
Players from both teams shook hands.
Both armies clashed near the border.
Players from both teams shook hands.
Both sides were evenly matched in ability.
双方 is a formal, neutral way to say 'both sides' (often in negotiations or legal contexts), whereas 両軍 is specific to military forces or sports teams.
両国 means 'both countries', while 両軍 means 'both armies/teams'—learners may confuse them because of the similar 両+noun structure.
Compound of 両 (both) and 軍 (army, forces). The extension to non-military contexts is a natural semantic broadening.