You win the battle by eliminating all enemy troops before they eliminate yours, pretty straightforward right? You will also be awarded Stars based on your performance in battle.
1-star : Win the battle
2-stars : Win the battle in less than x turns
3-stars : Win the battle in less than y turns
Obtaining 3 stars gives you the right to Sweep the battle, obtaining the rewards straight away without having to re-do the battle manually.