One thing to remember is that economic issues are always political issues. In the early 1800s the economies of the Northern and Southern halves of the U.S. began to diverge because while the North diversified with industry and trade, the South continued to be reliant on agriculture and therefore, slavery.
The second key to your question is the Wilmot Proviso. This was a bill that would have banned slavery in all of the new territories gained from the Mexican-American War. The Northern states (who had a majority in the House of Representatives) wanted it to pass, but the Southern states (who ruled the Senate) did not allow it. After this legislatory skirmish, the Free-Soil Party was founded, thus bringing the issue of slavery to the forefront of Congressional politics.
The last thing to keep in mind is that the Southern states were very concerned over the admittance of California to the Union. California wanted to enter as a free state, but its arrival would put the Southern slave states in the Senate minority. The Compromise of 1850 briefly settled the issue, giving California statehood. However, it allowed for greater control for slaveowners in the South, thereby exacerbating the slavery issue even more.