IT doesn’t refer to the horse - it doesn’t really refer to anything. We have an expression, to LORD IT OVER someone which means to act like you’re better than them or wave an accomplishment in someone’s face to make them feel useless. This is apparently the same concept, but with COME.
This means: “(She was generally nice to me(?)), but when she got angry, she had no problem becoming sanctimonious and treating me very arrogantly.” (WITH THE BEST OF THEM means easily, with no hesitation or difficulty)
“Alan has only been studying Russian for a year, and his Russian is far from perfect, but when he’s drinking, he can hold his own in a conversation with the best of them.” (=he keeps talking with no shame or hesitation)