Note that anything below 6 confirmations doesn't require 51% of the network, in theory. You are always trying to outpace the honest miners by mining blocks and building a longer chain than them. Luck becomes a less significant factor at 6 conf. Hence, the probability of you outpacing the honest miners increases with a higher hashrate and at 51% of the hashrate, you will always win.
Having bigger hashrate will increase chance to do it successfully. With same hashrate, with a more confirmations, chance to succeed with such attacks is smaller.