In the aftermath of the the Mexican-American War it was questioned whether or not to extend slavery to the territory gained in the war. This issue framed the election of 1848.
As a war hero, Zachary Taylor was a clear favorite at the Whig convention in June 1848. He received the needed two-thirds of the votes on the fourth ballot. The Democrats nominated Lewis Cass as their presidential candidate.
Taylor said very little on the question of whether slavery should be extended or not. Taylor did, however, own 200 slaves. His views were inferred from his actions. Cass, on the other hand, supported the view that each territory should decide for itself whether to allow slavery. Van Buren ran as a third party candidate on the Free Soil ticket, in total opposition to the expansion of slavery.
This presidential campaign was characteristic of the campaigns of the times, with each side slinging mud at the other. Taylor was attacked as a military autocrat, the Democrats went on to call Taylor “semi-literate”. The Whigs responded by calling Cass a “vagabond of evil”.
The election was decided by Van Buren. Although the ex-President did not win any states, the 10% of the vote that he did receive was enough to ensure Taylor's victory.