Clausewitz's Metaphor, which is accepted by most strategic thinkers in the area of international politics, says "War is politics pursued by other means"1, where each group has political objectives, and war may best serve those objectives. The political gains are weighed against acceptable costs, and when the costs of war exceed the political gains, the war ceases.
War is basically highly organised theft, in that in and of itself it serves no useful purpose other than to transfer control of whatever it is the two groups are fighting over from the loser to the victor. This item may be something small, like an oil field, something large, like Europe, or something stupid, like a Kings daughter.
For example, Genghis Khans people were good warriors. He united his people and used them to conquer the known world, which mostly consisted of farmers. After this was completed however, there were no more lands to conquer and the warriors, which produced nothing useful, had to settle down and become farmers themselves - although this took a few generations. Indeed Khans great-grandson became known as "The Builder", constructing an ancient equivalent of the United Nations.
Motivating people to go to war usually involves their rulers misinforming or bare-faced lying to them (otherwise known as propaganda) often justifying a war using historical or cultural means, although on occasion a religious or ideological zeal will overtake a nation and the righteous get to bathe in the blood of the sinners. Frequently, the item being fought over is of no relevance to the people doing the actual fighting, who would as happily kill whoever it was 'on their side' that had the bright idea of forcing them into war in the first place. Unfortunately for Joe Conscript however, the first priority of almost every ruling system in the world is to protect itself from people who fundamentally disagree with its legitimacy, so by the time a nations rulers decide to start a war, the more democratic method of removing the leaders and replacing them with more reasonable ones who just want everybody to get along usually isn't possible. Often, anyone refusing to fight for 'their' nation will be branded an enemy of the state and imprisoned or executed, depending on circumstances.