I'm under the impression that it was the defeat of the major army and then surrender and the complete end of the war. I'm not even sure this is correct.
But why didn't it end with guerrilla warfare?
Civil War history PhD candidate here. There are a couple of oft cited reasons. The most repeated reason is that Gen. Robert E. Lee rejected Gen. Porter Alexander’s suggestion that “the men take to the woods with their arms, under orders to report to governors of their respective states.” Why?
According to an early history based on Alexander’s memoirs, Lee was convinced the rebel army (exhausted, battered, and scattered throughout the South) would not be able to field enough men to mount an effective guerrilla war. He worried that it would only delay their inevitable defeat at too high a cost.
The Confederacy was running out of arms and supplies. Lee argued that he did not have enough rifles for an effective guerrilla force. Furthermore, irregular troops would need to live off the land—a fact severely limited by the destruction of Southern farmland and the relative infertility of Appalachia’s mountainous terrain.
By 1864 and 1865, the US Army was punishing civilians for guerrilla actions. Support for irregular forces (guerrillas, Partisan Rangers, etc) was highly localized as guerrilla relied on kinship networks and neighbors (often at the county level) for logistical support. The US Army began to burn down farms and arrest non-combatants who aided guerrillas, even going as far as evacuating entire counties. To make matters worse, support for the rebellion was declining rapidly on the home front, and fewer civilians were willing to risk their necks helping rebel soldiers they didn’t know. By 1865, irregular actions in the South were in total disarray, and Lee was well aware of its growing ineffectiveness.
Finally, Lee and his subordinate army commanders were largely convinced that any attempt to mount an organized guerrilla campaign would quickly deteriorate into simple banditry. Desertion was high in the rebel armies, and command and control was extremely disorganized in April 1865. The quality of the army’s junior officers (who would play a huge role in a potential irregular action) left much to be desired by the end of the war, as well. Plus, Lee and his officers had plenty of examples of irregular units devolving into marauders (see Willian Quantrill and Bloody Bill Anderson).
Now for a somewhat unconventional argument proposed by some historians...Some argue that the Civil War did, in a way, turn into a guerrilla war. One historian argues that the anti-Reconstruction paramilitary groups like the Ku Klux Klan amounted to a postwar insurgency. Others say that the guerrilla wars continued West of the Mississippi, as in the violence of Frank and Jesse James (former Confederate irregulars who fought in Missouri and Kansas) and outlaws in the Mexican borderlands. Most historians aren’t convinced that these acts of violence amount to a guerrilla war, though.