There are two contradicting statements -
PHB page 156: "If your base attack bonus allows you multiple attacks..."
MM page 312: "Creatures do not receive additional attacks from a high base attack bonus when using natural weapons."
I would love to ignore the MM statement, but that would allow a CR 6 Salamander to do over 12d6 damage in one round with two successful grapple checks. I am hesitant to give monsters that kind of damage potential over some ambiguous rule. That's why I don't allow the hydra to attack with all of its heads each time it gets an AoO.
So here is my revised interpretation of the rules:
The ape can use the "Attack Your Opponent" option with either the claw or bite. The claw attacks at +3, the bite at -2. If the attack hits, it does lethal damage according to the natural weapon used.
The ape can use the "Damage Your Opponent" option to make a grapple check at +12. If successful, the attack does 1d4 damage (unarmed strike damage for a large creature). However, the damage is lethal unless the ape took the grapple check at +8 instead. Also there is a strength bonus to damage that is dependent on which natural attack established the grapple in the first place. If it was the claw, then +5 damage, if it was the bite, then only +2 damage to the 1d4. The type of damage is not necessarily bludgeoning, which it would be if the ape were a human. Instead the type of damage corresponds to the natural attack that established the grapple (piercing and slashing for the claw, all types for the bite.)
The polar bear is now essentially the same as the ape in the number of attacks or grapple checks it can make (one per round). The Improved Grab ability allows the polar bear to do 1d8+8 claw damage with a successful grapple check instead of 1d4+8. The Improved Grab ability also gives the bear other options that the ape does not get (these options are in the Improved Grab description).