This is because different countries have different agendas. This usually causes a difference in opinion leading to conflicts. The other reason is where a country decides to side with another country that is not in agreement with another or a terrorist group attacks the citizens from another country.
From a purely philosophical nature. Peace can never exist between all of mankind, because all men have the desire to be the best, and some men will take that desire to far, and exacerbate it to the point of feeling the need to subjugate everyone.
Because jealousy, greed, strife, and discord are intrinsic to human nature. There will always be people who try to use force to take what they want from others, both on a personal and on an international level.
Why can't there be complete peace (no squabbling) in pre-school? Why can't there be peace (no bullies, no fights) in middle and high schools? Why can't there be peace in colleges? Why can't neighbors get along with all their neighbors? Why can't every person stop lying, stealing, cheating, robbing, fighting, and killing each other? -- When you've found an answer to all those questions, you'll have an answer to your question about War. ... War is really just the behavior of the common man but magnified 1000 times to the national and international level.