Organized religion certainly exacerbates these things quite horrifically, but they would still occur without religion.
The splitting into factions and groups is really just an evolutionary necessity of our past. Chimpanzees are extremely violent and triablistic in this sense too, and they war with opposing groups without "help" from religion and the God concept. It's all about competition for resources. Take religion out of human history and we will still have war, cruelty, slavery, and genocide, because we will still hate "outsiders" - it is simply the way we evolved. I'd imagine that the wars might be less fierce and costly without religion though - after all there is no better way to convince your people to kill other people than by telling them it is God's will. Organized religion is certainly an accomplice and an accessory to many great crimes and should be held in contempt for all these things. But it is not the root cause. We are a fucked-up species, but luckily in the last couple centuries we are starting to turn a corner, maybe.