Your ignorance of history is understandable, you're a leftist. But you really have no excuse for not reading your own links.
"The war with the United States followed in the wake of decades of Indian raids in the sparsely settled north of Mexico, which the avenger government-sponsored American migration to the Mexican province of Texas was aimed at buffering. Americans and some Mexicans revolted against the Mexican government in the 1836
Texas Revolution, creating a republic not recognized by Mexico, which still claimed it as its national territory. The 1845 expansion of US territory with its
annexation of Texas escalated the dispute between the United States and Mexico to open war."