Seeking to punish, redress a grievance, or simply strike back for a perceived slight can often be a factor in the waging of war. Revenge also relates to nationalism, as the people of a country which has been wronged are motivated to fight back by pride and spirit.
It might be some territory or some money or something else. Worst case, the losing country is occupied by the winning country, there is a regime change, and maybe even some harsh reparations are imposed.The losing country might even be annexed by the winning country and cease to exist as an independent entity.