In the case of monkeys, I wouldn't doubt if someone unaware of this smiled at one and angered it. Monkeys do live in human-populated areas in various places, and they have a bit of a reputation for stealing things from people that interest them, especially food or anything they think could be a source of food, so average humans do interact with monkeys regularly in some places. I'm sure most locals know how to behave around monkeys, but tourists probably don't. Fortunately, most great apes would be more isolated from human civilization, which is good because despite being basically half the size, chimpanzees are also about twice as strong as humans, and can be pretty aggressive even amongst one another (although much like humans, it varies on an individual basis).