Don't be evil.
Official corporate motto of Google
Following on the inevitability of a widespread belief in some sort of god (chapter 3), the belief in a battle of good versus evil is equally inevitable.
The reasons I set out in chapter 3 for people believing in God (cause of our world, dispenser of justice, host of an afterlife we hope will be enjoyable, source of comfort in stressful times) imply that, in general, God would be seen as a positive force, a force for niceness and pleasant experiences: a force for Good, the creator of our knowledge of what Good is. But in our search for explanations for everything, it then becomes necessary for us to have a way of understanding why bad things, ranging from unpleasant to tragic, happen. So the religions followed by most of the world's people attach crucial significance to the existence of a force for Evil, outside of God, and an ongoing battle between Good (represented by God) and Evil.
Some see the battle as equal, the outcome uncertain. In the world's largest religions, however (I'm thinking of Christianity and Islam here, two religions that, combined, are followed by about half of the human race), God is an all-powerful force, His victory inevitable -- which makes it hard to explain why such a God would tolerate the existence of Evil to begin with. This is, of course, not something I just thought of that everyone else has overlooked. It is simply a statement of the famous "Problem of Evil," a name for the pesky question of why an omnipotent God would allow Evil in the world. One of the earliest critics of Christianity, the Greek philosopher Celsus, said in the 2nd century: "It is blasphemy... to say that the greatest God... has an adversary who constrains his capacity to do good," and went on to say that Christians "impiously divide the kingdom of God, creating a rebellion in it, as if there were opposing factions within the divine, including one that is hostile to God". (From Wikipedia: Satan.)
(Keep in mind what I said about Wikipedia earlier: If you don't like Wikipedia itself as a source, then trace back the various references given in the article to their original sources.)
For thousands of years the argument has persisted, and rather than summarize all of the points and counterpoints here (which would probably make this book three times longer than it currently is, and I don't know what the purpose would be of doing so), I'll just direct you to Wikipedia again: The Problem of Evil.
Instead of examining the arguments, I'll take a step back and look at the outcome of the arguments: nothing. Nothing is settled, or even close to settled. No significant number of believers have ever been convinced by any argument explaining why the existence of evil proves God doesn't exist (or at least not in the "omnipotent" way His worshippers picture Him); no significant number of non-believers have ever been convinced by any argument explaining why God tolerates the existence of evil.
I'm in the latter set, of course: I have not seen any reasoning, addressing how an omnipotent God and a frequently-successful contrary force can coexist, that makes me think, "You know, there's something to that." I believe that good and evil exist, but not a Force for Good and a Force for Evil: those forces simply come from our internal search for a narrative (again: chapter 3), in this case a story that explains the good and bad events that occur in our environment. As part of the narrative, we have a habit of personifying things so we can assign credit or blame for events in our surroundings. In the case of good and evil, God and Satan (or various other names for the same things) are the personifications we establish to account for those good and bad events.
Of course, as is our custom when we have centuries of time on our hands to give thought to an idea, the human race has expanded the concept. Good and Evil are not only forces; they are also teams, of which any of us can be members -- good people are members of Team Good, bad people are members of Team Evil.
Some people take this idea of teams to such an extreme that they believe no one can ever be on the sideline: they see everyone as being intrinsically on Team Good or Team Evil. Groups and organizations of people, as well, must belong to one or the other team. As these people see it, each team member actively works for his or her own team. That is, according to the belief system of people holding this view, evil people do bad things, and it's never because of (say) desperation caused by the stress of financial misfortune, or a prolonged period of unjust treatment (see "sense of justice" in previous chapter) -- when members of Team Evil do bad things, it's always simply because they are evil and it pleases them to do bad things.
Having, or not having, such a viewpoint is completely unrelated to intelligence. If, like me, you are not one of the many people who perceive everything in terms of membership in Team Good or Team Evil, you're wrong to dismiss people who do see things that way as "simple-minded" and "not very bright." I once knew a woman who was clearly very intelligent: she completed a university degree in mathematics with straight A grades throughout. I don't just mean A's in math. She got A's in every college course she took: not just higher-level university math, physics, biology, and so on, but also English composition, world history, art... everything. So she functioned intellectually on a far-above-average level. And this woman, once, expressed puzzlement to me over the official name of the country of China: she couldn't understand how it could be "The People's Republic of China." She said: "Isn't a 'republic' a good thing? Why do they call themselves a republic?" And you had to be there; you would have seen it was only puzzlement and nothing more. She wasn't trying to score a political point. She just wondered how they could use that word. I tried to explain to her that nobody, anywhere, ever sees himself as the bad guy. I didn't get a feeling it was getting through. In her way of thinking, a country that was a member of Team Evil should know which team it was on, and it appeared to me that she honestly, truly had expected the government of China to refer to their own country as the "Evil Repressive Dictatorship of China." She couldn't figure out why they didn't. It's just how she saw the world.
In the U.S., it's also how the National Rifle Association sees the world. As the NRA puts it, "The only thing that stops a bad guy with a gun is a good guy with a gun." Underlying that statement are two assumptions: (1) that everyone is either a bad guy or a good guy, and that, as I said above, the bad guys are intrinsically, permanently bad, and do bad things because they like doing bad things, and that similarly the good guys are intrinsically, permanently good and like doing good things, and (2) that you can always tell the good guys and bad guys apart, as if they all wear team uniforms. Brushed aside are any examples of people who commit crimes, with guns, that no one ever saw coming, even though the news media are constantly full of such stories ("He was always so quiet, so sweet, so thoughtful. I never thought he could do anything like this!"). The NRA wants all the good guys to have guns, despite all the undeniable evidence that, once a person that everyone thought was good (qualifying them for gun ownership, in the eyes of the NRA) gets a gun, that person might then do a bad thing with it. An evil thing. No, no, the NRA will tell you, impossible. The teams are set in stone. There are no gray areas in between, no reason anyone ever commits an evil act except that he or she was visibly an evil person.
I am one of those people who believe that the human race is not, and has never been, organized into such a clear-cut and permanent dichotomy of good and evil. It might be, if the teams had captains: God in charge of the Good, Satan in charge of the Evil. But I don't believe there is any force out there making Good and Evil happen. They just happen, and always for reasons far more complex and transitory than many people want to believe, or sometimes for no underlying reason at all.