The Mexican-American War broke out because of tensions between the United States and Mexico over the annexation of Texas. The conflict between the North and the South was caused by disagreements over whether the war was justified and over the issue of slavery. The outcome of the war was the annexation of Texas and the cession of California and New Mexico to the United States.
Hope this helps :)