I think there are many reasons why we have wars. A lot comes from pure greed at the expense of many innocent lives. For example, a few bad people may want the oil resources of another country, so they find a reason to get others to attack them, often telling lies about the real reason. They will make up stories, like they are about to attack, when it is not true, or other ways that use government power. The poor soldiers fighting often truly believe in the fake story, but in the end it was not real and all about the greed of a few at the top. Many of the soldiers had terrible lives because of government rule forcing them to live in poverty, so fighting in the army was seen as a way to improve things for them.
However, there are a few exceptions where war was needed. Most people feel that the Civil War to end slavery was a good cause, even though it killed over a half million people. World War II and stopping Nazi Germany is another good cause that sadly took the lives of over 60 million people.
It would have been best if talking could have avoided these wars, but sometimes words just don't help and you need to fight. As long as this world has bad people willing to hurt others, war is often unavoidable.