The Texas Annexation in to the U.S. happened soon after Texas declared their independence from Mexico, but not without some complications. Complications like a few battles... and a war.
Before the Annexation of Texas, Texas declared it's independence from Mexico on March 2, 1836 after their victory in their war for independence. After that happened, the U.S. tried to move in and bring Texas. They tried but Mexico sent threats to them about declaring war if they annexed Texas. However they did not follow through with their threats, but that does not mean that the U.S.'s and Mexico's relationships were tense after that. Their relations were tense because if the U.S. annexed Texas then they would most likely be instantly at war because of unresolved border disputes. After those years the U.S. finally tried to annex Texas in to the U.S.
Slightly before the Annexation of Texas President John Tyler wanted to negotiate with Mexico with a Treaty of Annexation. That happened in April, 1844. That also was rejected by the Senate. Later in March, 1845, Tyler got support from President-elect Polk and then it passed. Then Texas was finally annexed in to the U.S. in December, 1845.
Throughout the Annexation of Texas, Texas still had border issues with Mexico. When it was annexed those issues went with Texas to the U.S. And Mexico still threatened war but they did not. Like stated before their relations were tense because of the border issues.
After the Annexation of Texas, Polk was in office. In July, 1845, he ordered Zachery Taylor, the U.S. commander of the army in Texas, to move his forces to the Nueces River and the Rio Grande land. The land that Texas and Mexico said they had and the other did not. Then in November, 1845, Polk ordered Congressman John Slidell to negotiate the disputed land. Slidell failed in May, 1846. Even though he failed, President Polk heard news of skirmishes along the disputed border. Polk used that news to persuade Congress for a war with Mexico. Basically, another way to get that land.
After that war the U.S. had captured Mexico City and then they began the original negotiation plans that failed previously. Those negotiation plans were similar to the ones that John Slidell has attempted to get back in November, 1845.
That war also got the U.S. set set up for more expansion, to the California area.