From the words on Mark Linfield (co-director and producer) from npr.org :-
One of the reasons that these monkeys are relatively easy to film in
some sense — and by that I mean in the sense of getting close to them
— is that there's been a monkey study there for 50 years. Round the
clock, pretty much, these animals have been studied by researchers and
they're known incredibly well, so they were incredibly good at
deciphering the monkey's behaviors and also helping us to anticipate
what would happen next. ...
They do so much and every single animal is doing something interesting
pretty much all the time [so] that if you don't stay focused, after 2
1/2 years of filming in the field, which is what we spent, you would
just end up with hundreds of hours of just wonderful material but not
being able to make head or tail of it. So you really have to decide
which characters to follow. And once you've committed to them, of
course, you hope that their story becomes interesting.
From the interview of Jane Goodall for the birthday scene :_
Q : One memorable scene shows the monkeys raiding a birthday party. How was that filmed?
Ans : Well first of all, the monkeys—the lower-ranking ones—regularly go out of the forest into the city because the higher
ranking monkeys get all the best food in the forest. So they have to
try and supplement their diet, and there they are living on the
outskirts of the city.
The birthday party—they knew there was a birthday party happening.
They knew the monkeys were likely to be making a raid about that time
because the monkeys have been studied for 40 years and their patterns
of behavior are pretty well known. So all the team did, they persuaded
the people putting on the birthday party not to chase the monkeys away
and promised that they would buy more food. [laughs]
Dr. Wolfgang Dittus was the scientific consultant and has been
studying the macaque monkeys of Sri Lanka for nearly 50 years. His and
Jane Goodall’s study at Gombe are the longest running studies of wild
primates. For the film, Dittus helped select the monkey characters and
decipher their behaviour.
So it all shows that how thinks work around in the production side, and they clearly stated that Dittus and Wolfgang's studies were the main help behind the documentary. And it was all filmed naturally without a script, they just used their natural behaviors to their use and might given few opportunity like a birthday party to easily crash etc else were all natural.