On May 13, 1846, the United States declared war on Mexico. This war was an important milestone in our history; it was the first time we kicked around a modern nation-state. Before that point, our military adventures were limited to trying not to get invaded, and kicking around aboriginal tribes.
We actually tried to be peaceful and play by the rules. Texas had a right to declare independence, and we had a right to add new states to our commonwealth. In 1845, we sent an ambassador to Mexico with an offer to pay them a ton of money for Texas, California, and all the areas in between. The Mexican president was willing to negotiate with us. But then the Mexicans accused this president of treason and deposed him, and kicked out our ambassador. The USA said, "Fine, be that way" and sent in the troops.
Two years later, we owned everything we wanted. We were extraordinarily generous with the peace terms. Despite the fact that we had crushed all military opposition and occupied their capital, we only took what we had originally wanted to buy, and we actually paid them about half of our original offer. There was a political faction in our government that wanted to claim the entire place, but that idea never got any real support.
The war was actually rather controversial. The southerners supported it but the northerners generally opposed it, because it added more slave territory to the Union. Ulysses S Grant famously said "I was bitterly opposed to the measure, and to this day regard the war, which resulted, as one of the most unjust ever waged by a stronger against a weaker nation."
Of course, it was not immediately apparent at the beginning of the war that Mexico was the weaker nation. They certainly thought that they had a fighting chance; we did not have any obvious military superiority at the beginning. Our nation had almost no standing army, and no experience with waging large-scale aggressive wars.
This war was a milestone in military history for several reasons. It was the first time that reporters were on the scene of the battles, and able to send rapid reports back home. It was also a clear demonstration of how rapidly military technology was evolving. The Mexican army was using weapons that had been the state of the art 40 years earlier, but our infantry weapons and artillery were far superior, due to recent advancements in firearm design. They had muzzle-loading muskets, while we had breech-loading rifles and revolvers.
This advance of technology would continue to dominate the face of war. With every war since this one, new technology had some big impact on either the outcome or the casualties. Old thinking could not keep up, which inevitably led to led to disasters in military strategy all the way from Fredericksburg to the occupation of Iraq.