Berry yield is determined by how much you watered the bush. Berry plants have four stages of growth, which can be seen by checking it and looking at it's size/shape. To get maximum yield, you need to water it once per stage. Bulbapedia has the berry yield equation in their article on Gen 3 berries:
I had to take a screenshot, because the equations were broken when pasted. What this equation means for a player trying to get maximum berry yield, is that you need to water the berries in each stage, and then you have a chance of getting maximum yield. Different berries have a different value for Yieldmin and Yieldmax, and as a general rule of thumb, common berries have higher minimum and maximum yields, and rarer berries have lower numbers for those variables.
Source: Bulbapedia, and my horrible experience trying to get a Milotic in Emerald.
Hope I helped.