We called it Manifest Destiny.
Mexico couldn’t hold onto any of its territory in our present day southwest because that government remained basically a highly-centralized colonial-style government for far too long.
Officials were loathe to leave Mexico City. It was the center of power and influence in Mexico, because family ‘influence’ and toadying to those in power was the only way to move up in the government. So the regions far from Mexico, like California, Texas and New Mexico’s puelblos, were deemed the equivalent of being sent to exile in Siberia. No one wanted to be sent there and those who were sent were not the finest men for the job.
Indians raiding in the north were a problem for pioneers and Mexico did nothing to protect them. Americans moving west would become Mexican citizens but were intolerant of that government’s corruption and lack of action.
The rest is history about which Mexico blithely lies.