Company performance is not dependent on the performance of any one single individual. That is, I can be the laziest, most incompetent developer or middle manger, and it would have no bearing on quarterly earning. So if you're using company-wide performance bonuses to stimulate productivity, in a company of thousands of employees, you're doing something wrong. The incentive in that case is for each individual to do as little as possible because why exert yourself if you're just going to get as much as the next guy anyway, and the result is everyone loses. This is a classic "tragedy of the commons" scenario, where the incentive is to be a cheater.
So the idea of rewarding high achievers (carrot) and punishing under-achievers (stick) is a good one. That's what you need to do, and that's how you properly set up the incentives. The problem is that in a company of thousands of employees, creating a ranking system that works perfectly is pretty darn hard, especially since metrics are usually ambiguous and subjective. So you're not going to get it right 100% of the time.