As Americans spilled into lightly populated and loosely governed northern Mexico, Texas and then other Mexican provinces became contested territory.