The result of any attack will vary depending on a multitude of factors. Each player's troop type, amount, tier, Guardians, and boosts all play a role. A higher power count does not equal a certain victory, your strength in battle comes from choosing the right strategy for the right target. 

Winning a Fight
As a general rule, the side that creates more casualties will be victorious. This rule will apply anytime there are surviving troops on both sides. In the case of a draw, the attacker side will be the winner.
This rule won't apply in the case of one side getting completely annihilated, meaning no troops survived. In that case, the annihilated side will lose the battle. In case both sides were annihilated the defending side would win.

Guardian Imprisonment
When you win against an army of another player, you have a chance to imprison the Guardian that your enemy used in the battle (provided that both you and the enemy have reached the level 10 of your Palaces). Afterwards, you can sacrifice it to get bonuses for your city.