When Teddy Roosevelt and other declared Republicans refused to support the candidacy of James G. Blaine in the 1884 election, and instead threw their support to Democrat Grover Cleveland, Charles Dana of the New York Sun labeled them mugwumps.

While the political history explains why the term refers to independent minded voters who buck their party, I think Benny Hill summed it up nicely: what's the definition of a mugwump?
A fellow with his mug on one side of a fence and his wump on the other.