Actually historically speaking, that sort of thing is an aberration. WW-II was like that, but most wars are not. Military officers study Carl von Clausewitz, who said "War is not an independent phenomenon, but the continuation of politics by different means" . . In a little longer expositioin he wrote "If war is part of policy, policy will determine its character. As policy becomes more ambitious and vigorous, so will war, and this may reach the point where war attains its absolute form. . . . Policy is the guiding intelligence and war only the instrument, not vice versa."
The war must be fought in such as way as to further the political goals for which it is being fought.That is true even when one is attacked and responding to that attack. of course the relationship is mutual and the politics (that is policy) must support the war effort as well.