@layman,
See if you can follow this little historical timeline, eh, Max?
1. 1821: Mexico get independence from Spain. In the process it gets the right to Spain's ancient "claim" to land, including but not limited to what are now the states of Texas, New Mexico, and Arizona.
2. 1821-1829. There are virtually no Spaniards in these states and Mexico has no control whatsoever over the incessant raids from these "states," into other (further south) parts of Northern Mexico by native americans. Mexico therefore actively recruits immigrants from the USA to move into Texas so that they can provide a "buffer zone" between the Native Americans and the rest of the country.
3. 1829-35. By 1829, there are more Americans in Texas than Mexicans, so in that year Mexico makes all further immigration by US citizens into Mexico illegal. But the American just keep encouraging their homeys from the US to truck on in illegally, which they do. By 1835, the Americans have the Mexicans in Texas greatly outnumbered.
4.1835. The Texans then declare independence from Mexico and proceed to kick their sorry ass.
5. 1836. Santa Ana concedes defeat and Texas becomes an independent nation
6. 1845. Texas annexes itself to the USA and become the 28th State.
7. Oh, yeah....this was all before 1861. Who the **** knew!?