If you are in a random room, then a little bad luck... but thats still a pretty small sample.
if you are in a non-random room... it seems to me that the lower leveled character always wins. if characters are the same level, I haven't figured that out yet (i assume then its either random 50/50 or that the attacking or defending character always wins)
In random rooms, whoever has the highest pill has a greater chance of winning even if the other player has a higher AP.
In non-random rooms, in the event when both has the same AP, star count comes first. If your card is let's say 2* and the other is at 5*, you win. But if both has the same star count and the same AP, the attacking player wins the round.