How did Texas get annexed into the United States?
Settlers (primarily from Tennessee and other Southern US states) considered the land available for the taking. A significant number of Mexicans who had been there for generations (Los Tejanos) were unimpressed with Mexico's administration of the area; they partnered with the white American settlers and fought to make Texas a republic. (Mexico, itself a new nation recently independent from Spain, retained the Spanish holdings of what are now the Southwestern United States; it only had these lands for 12 years, the first 12 of their own independent existence.) After breaking away from Mexico, Texas existed as a sovereign nation whose borders Mexico disputed for the entirety of the Republic's existence, for about a decade (March 2, 1836, to February 19, 1846) and was annexed by the United States, triggering a two year war between Mexico and the US. By war's end, most of the present-day Southwest fell under American administration.
I don't want to imply that los Tejanos had no regrets about siding with the Americans; many who initially sided against Mexico switched sides during the Mexican War, and not without good reasons. Seguin, TX is named for Tejano leader Juan Seguin who initially fought against Mexico and eventually fought against the United States. In petty retribution, Texas renamed the town for Seguin's father--coincidentally also named Juan Seguin.
The process of Texas getting annexed by the United States is an interesting story. Many Americans moved to Texas when the Spanish wanted to more settlers in Texas around 1820. After Mexico got its independence from Spain, Texas was now part of Mexico. Eventually, relations deteriorated between the Texans and the Mexican government. When General Santa Anna ended the Mexican constitution, the Texans revolted for their independence from Mexico.
In the war with Mexico, Texas emerged victoriously. The Texans captured Santa Anna. In order to regain his freedom, Santa Anna had to require his army to retreat into what is now Mexican land. His troops crossed the Rio Grande River and went back into Mexico. Texas claimed it was now independent. The Texans wanted to join the United States right after becoming independent. However, this didn’t occur because northerners didn’t want another slave state in the Union. There was also concern that Mexico might declare war on the United States because Mexico didn’t officially recognize Texas as an independent nation. Thus, Texas was an independent republic for several years, called the Lone Star Republic.
In the election of 1844, James Polk campaigned on a platform of expanding the United States. After he was elected, one of the places he wanted to annex was Texas. Texas was annexed into the United States on December 29, 1845.