Garfield was not the obvious choice as the Republican candidate in the election of 1880. He and his opponent, Civil War hero Winfield Hancock, differed in little besides the tariff issue. Republicans wanted a high tariff.
This election is one of the closest in terms of the popular vote. The electoral votes were not quite as close, due largely to New York leaning toward Garfield at the end. It is possible that Garfield promised favors to the party bosses in that state.