The exact rule is: If you put more "extra gems" into your dispel than the caster of the enchantment used when he cast the enchantment, then the dispel will be successful. If you used less, the enchantment survives. If there's a tie, the spell is dispelled.
It's possible there may be a slight random factor - but who can say for sure?