Thing is, fear of the unknown is a genetic trait, that much is certain, Orangutans, as you say, rarely attack or kill each other, but if a member of another 'group' of Orangutans enters their territory, it's a whole other matter, that's the genetic side at work.
The problem is, however, social as well, for example, in the UK we have 15-year olds committing racially motivated attacks against Africans and Asians, now both races have been a pretty common sight in the UK, particuarly London for about 20 years, so they aren't 'unknown' to a 15 year-old, they've been seeing and interacting with other races all their lives, the motivation there is Parents, Peers and Media. Orangutans may attack other groups that enter their territory, but they don't teach their children to hate the group on the other side of the hill, they simply don't care about them unless there's a territorial problem, and then it is fear that motivates their actions more than Social conditioning. Though, to be perfectly fair, in the case of Primates, there may be more to it than that.
Also it needs to be borne in mind that if Orangutans had guns instead of fists, they'd probably kill a lot more of each other.