That is the best analogy. The US went to war with Mexico (in disputed territory), beat Mexican army after Mexican army. Occupied Veracruz, San Diego, Albuquerque, Monterrey, Mexico City, etc. etc. and seemed poised to continue gobbling up Mexican territory and destroying Mexican armies.
In exchange for a cessation of hostilities and returning territory to Mexico, the US accepted Tejas and California.
Say Mexico had said, "No way. You gringos are the aggressors. We refuse to reward your aggression, so we will fight on!" What would have been the outcome? The
complete conquest and annexation of
all of Mexico, and probably the
forced anglicization of the Mexican population (in 2025, would would have English-speaking US citizens from Vera Cruz, Cancun, Acapulco, Puebla, etc.)
In exchange for the cessation of hostilities and the return of American-occupied Mexican territory (including Mexico's capital), the Mexicans had to cede Tejas and Alta California. Today Mexicans gripe about it, but the alternatives in 1848 were
not (a) the 1824 borders:
View attachment 52160
or (b) the 1848 borders:
View attachment 52161
The alternatives on the table were (a) the 1848 borders or (b) the American annexation of all of Mexico and the disappearance of Mexico as an independent country.
Given the latter set of alternatives, the Mexican authorities agreed to the 1848 borders.