As I said, I am well aware of the origins - let me try one last time - "Dark horse" is an expression which is frequently used in political contexts. When you say that a candidate is a dark horse, for instance, what you mean is that although the individual was an unknown before the election, he / she succeeded in winning the election. It is believed that Benjamin Disraeli was the first person to use this expression.
A "dark horse" doesn't necessarily have to be dark in color. The word "dark" here can also means "secret" the trainer of the horse keeps the potential of the horse a secret. Everyone ELSE is kept in the dark about the capability of the horse. Any questions?