The incumbent President, Pedro Hermión, was assassinated on the floor of the Mexican Congress after delivering a special address on 19 June 1851. Suspicion immediately fell on former president Miguel Huddleston, the leader of Niles' Liberty Party, because the assassin shouted "Viva Huddleston y paz!" before being gunned down by the Congressional Guard.
The leaders of the Liberty Party were understandably wary about who they should nominate for president in the upcoming August elections, and they finally settled on Niles. The campaign was a quiet one, in deference to the recent death of Hermión, but Niles' opponent, Acting President Raphael Blaine, couldn't resist the temptation to ridicule him as "the faceless wonder of San Francisco" and mock his butterfly collecting hobby.
Niles won the election, and offered to negotiate a truce with his opposite number in the C.N.A., Governor-General Henry Gilpin. Gilpin, however, was determined to win conquer Mexico, and spent the next year and a half launching a series of futile offensives, before finally being turned out of office in February 1853. Gilpin's successor, William Johnson, accepted Niles' offer of negotiation, and a truce was declared in August while an international arbitration panel in The Hague compiled a report on a possible settlement.
In the meantime, Niles took advantage of the truce to repair the damage of the war, and try to restore the Mexican economy. Then, in 1855, the panel issued its report, recommending that Mexico cede some territory to the C.N.A., and that the C.N.A. pay an indemnity to Mexico. Both nations agreed to the terms of the proposed treaty, and the war officially ended in August 1855. However, Niles' political opponents denounced the treaty as a shameful surrender, and for the remainder of his term, Niles lived in constant fear of assassination. When he ran for re-election in 1857, he was defeated.
All works of history are the products of the time in which they were written, because a writer can't help but see the past through the lense of the present. This is even more true of a work of alternate history like For Want of a Nail, because the writer uses his own understanding of how history unfolds, and his own experiences of current events, to create his imaginary history. Given this reality, the question that inevitably arises is the extent to which the incidents in the alternate history reflect the writer's own beliefs.
For Want of a Nail was written in the summer of 1971, at a time when the Vietnam War was the dominant political issue confronting the United States. Robert Sobel was writing Nail at a time when the Pentagon Papers were being published by the New York Times, revealing that the Johnson administration had been systematically lying to the public, and to Congress, about the war. As a result, popular opposition to the war, which was already high, increased even more. Protests against the war had been growing since 1964, and the year before, four students had been killed by National Guardsmen at Kent State College in Ohio during an antiwar protest.
In Nail, the populations of both nations in the Rocky Mountain War want it brought to an end by 1851. Both major candidates in the U.S.M. campaign on negotiating a peace agreement with the C.N.A. However, as soon as a treaty is actually concluded, the Mexican people (or at any rate, those with a voice in politics) denounce it, and within two years the man who was elected to end the war is driven out of office.
The closest parallel in American history to these events is the Communist victory over the Kuomintang government in the Chinese Civil War in 1950, and subsequent Republican Party attacks on the Truman administration for "losing China." The Republicans subsequently won the 1952 Presidential election amid claims that the Truman administration's foreign policy was directed by Communist Party members in the State Department.