Looking back, we can see that between 1865 and around 1914 the Union and the former South negotiated an imperfect but workable peace. The first step in that negotiation took place at Appomattox, when the Union troops accepting General Robert E. Lee’s surrender saluted the defeated and allowed them to retain their arms, treating them with the most punctilious military courtesy due to honorable foes.
Over the next few years, the Union Army reintegrated the Confederate military into itself. Confederate officers not charged with war crimes were generally able to retain rank and seniority; many served in the frontier wars of the next 35 years. Elements of Confederate uniform were adopted for Western service.
The political leaders of the revolt were not executed. Instead, they were spared to urge reconciliation, and generally did. By all historical precedent they were treated with shocking leniency. This paid off.
Of course, not all went smoothly. The Reconstruction of the South between 1863 and 1877 was badly bungled, creating resentments that linger to this day and – in the folk memory of Southerners – often overshadow the harms of the war itself. The condition of emancipated blacks remained dire.
But overall, the reintegration of the South went far better than it could have. Confederate nationalism was successfully reabsorbed into American nationalism. One of the prices of this adjustment was that Confederate heroes had to become American heroes. An early and continuing example of this was the reverence paid to Robert E. Lee by Unionists after the war; his qualities as a military leader were extolled and his opposition to full civil rights for black freedmen memory-holed.