You can read the rules of carefully. But to put it in simple words:
1. Random checks the ATTACKS of you card and your opponent's card.
2. ATTACK is checked by multiplying the number of PILLS to the POWER of the card, then adding/subtracting modifiers from abilities or bonuses.
3. Random works by adding BOTH ATTACKS to get the TOTAL NUMBER OF CHANCES OF WINNING.
Zdrone 4* (Power = 5) with 5 pills, bonus activated vs. Kinjo 5* (Power = 6) with 7 pills
Zdrone's ATTACK = (5 x 5) + 8 = 33
Kinjo's ATTACK = 6 x 7 = 42
TOTAL ATTACK = 75
Random works this way:
Zdrone has 33 out of 75 chances to win while Kinjo has 42 out of 75 chances to win. The game then uses a program to see who wins.
A high number of pills means HIGHER CHANCES OF WINNING, and not merely WINNING.
hope that helps.