In most games, it's non-random. Which means a few things:
The character with higher attack always wins.
If two characters are tied in attack, the one with the lower level wins.
If the characters are the same level, the one that was played first wins. IE, if your opponent played Ambre first, the Ambre would win if you both ended up tied in attack.