When you destroy the defender's City Castle, you win the battle. 

When you destroy all the buildings in the defender's city, you score a 'Massive Win'.