It’s not the size of the dog in the fight, it’s the size of the fight in the dog.

Mark Twain (1835-1910) American writer [pseud. of Samuel Clemens]
(Misattributed)

Scholarly research finds no actual connection between Twain and the origin of this phrase. It appears to have been first crafted by columnist Arthur G. Lewis, Book of the Royal Blue Magazine (1911-04):

It is not the size of the dog in the fight that counts, but the fight in the dog that wins.
 

For more discussion of the origins and variations, see Quote Origin: It’s Not the Size of the Dog in the Fight, It’s the Size of the Fight in the Dog – Quote Investigator®.