The first is when people try to compel other people to adopt their religion or religious perspectives. This comes from our innate tendency to want other people to subscribe to our beliefs. That desire can be accompanied with a strong zeal such that if others are impervious to our peaceful approach to convert them to our beliefs, we can even resort to violence to achieve that end. History is replete with such examples. One example was shown during the initial propagation of Islam when the Prophet Mohammad actually declared a holy war against the desert kingdoms and cities of Arabia. The purpose of the holy war was compel the infidel Arab people to embrace the new religion he had founded. This kind of religious conflict was also amply demonstrated during the Thirty Years' War of the 1600s. Catholics and Protestants in Europe were locked in a long and devastating conflict that arose out of a desire of the warring religious and political leaders to force each other to accept their own interpretation of what Christianity should be.
The second instance when religion can cause war is when a nation of a particular religious conviction goes to war against another nation, not to convert it to their religion, but to simply eliminate them as people who are unfit to populate a certain geographical locality. It is nothing more but the expression of a bias against another group of people because they do not subscribe to the same faith or religion. This was the nature of the violence that erupted between the Old Testament Hebrew nation and their neighboring desert tribal nations such as the Canaanites, Edomites, and the Moabites. As narrated in the Bible, the Hebrews had to wage wars against these neighboring kingdoms, not so much to convert them to the Hebrew faith, but as an act