If you're losing a war, you can surrender to end the war. In an armistice, neither side surrenders, but both agree to end the war. Is there a term for a side that is winning that has a change of heart and ends the war unilaterally?
A ceasefire or truce both appear to be cessations of hostility that are somehow less than an armistice. Neither appear to be unilateral.
I understand that it probably doesn't happen much, so there may not be a word for it.
As to why such a thing might occur, besides just thinking better of it or having an election that leads to a new direction from leadership, I could also see enough Pyrrhic victories leading the aggressor to give up on the war, but certainly not surrender or even enter into an agreement of any kind.