Since the U.S won the war after the signing of the Treaty of Guadalupe Hidalgo, in the U.S favor, Mexico had to push it's border back while U.S gains the territory. What this territory is referring to is modern day Texas. The Mexican-American war was a war between the U.S and Mexico, the U.S fought to take Mexico's land while Mexico fought keep their land. The boundary changed between Mexico and the U.S after the war by Mexico pushing its boundaries back to the Río Grande river, while the U.S gained all of the land that Mexico lost. Mexico lost land while the U.S gained land. After this boundary change, the U.S took the land and called it what is known now as Texas, while Mexico lost some of its territory in Northern Mexico.