how did the war with mexico lead to conflict between the north and the south?

Texas was pro-slavery.

http://www.pinzler.com/ushistory/timeline5.html

The war with Mexico indeed played a significant role in escalating the conflict between the North and the South in the United States. Here's how it happened:

1. Expansion into new territories: As a result of the Mexican-American War (1846-1848), the United States gained vast territories in the west, including California, New Mexico, Nevada, Arizona, and parts of Colorado and Wyoming. The question of whether these territories should permit slavery or be free states intensified the sectional tensions between the North and the South.

2. Slavery's expansion: The addition of new territories raised the issue of whether they would allow slavery or be free. The South, which heavily relied on slave labor for agriculture, wanted to expand slavery into these newly acquired territories to maintain its influence and power. On the other hand, the North, which was more industrialized and had abolished slavery in several states, opposed the expansion of slavery into these areas.

3. The Wilmot Proviso: In 1846, Congressman David Wilmot from Pennsylvania proposed a legislative amendment called the Wilmot Proviso. It aimed to ban slavery in any territory acquired from Mexico. This proposition further intensified the debate on whether slavery should be allowed in the new territories and contributed to the growing divide between the North and the South.

4. Compromises failed to resolve the issue: Several attempts were made to find a compromise and settle the disputes arising from the war with Mexico. The most notable of these was the Compromise of 1850, which included provisions such as the admission of California as a free state, the organization of Utah and New Mexico territories with popular sovereignty (allowing residents to decide whether to permit slavery or not), and the strengthening of the Fugitive Slave Act. Although these compromises temporarily eased tensions, they were not able to permanently resolve the issue, and conflicts persisted.

The war with Mexico, in combination with other events and factors, contributed to the deepening divide between the North and the South over the issue of slavery. This ultimately led to the outbreak of the American Civil War in 1861.