At the Institute for Marine Mammal Studies in Mississippi, dolphins are trained to pick up the garbage that falls into the pools, be it a piece of plastic or a dead gull, and take it to the trainer when they see one, and in exchange they get fish for their good deed. One dolphin, Kelly, decided she can do better. She started to actively collect trash and store it under a rock at the bottom of the pool only to quickly give it to a trainer when one came by. But that was not all. If she stored a piece of paper for example, she tore only a part of it, gave it, got a fish, went back, tore one more piece, gave it, got one more fish, and so on. One day she gave the trainer a dead gull that fell into the pool, and she got a lot of fish for it. She learned from that and the next time she was fed she saved the last fish, stored it, and used it to lure a gull, kill it, and give it to the trainers for fish. She soon started to routinely lure and kill gulls which she traded for fish with the trainers. She taught her kids to do it, and they taught their kids to do, and now most of the dolphin population at the Marine Mammal Studies in Mississippi does it.
This is a true story. Let's rephrase it. The trainers are the management. They decide it's a good idea to ask the dolphins to help clean their own pool. They agree on a desirable action (bring piece of trash) which they want to measure and instituted a reward for it (a piece of fish). In effect, they put in place a KPI. They think this is going to cause the expected behavior in dolphins. It doesn't, because there's no deep shared understanding of what the trainers really want, there is only a transactional agreement of "bring me trash, I give you fish". And, as always in management, you get what you measure. You measure how many pieces of trash you are given, you will be given as many pieces of trash as possible. The dolphins on the other hand, displaying remarkable intelligence, decide to maximize their gain and self interest from this arrangement, an otherwise very rational decision, so their goal now is to collect or create as many pieces of trash as possible.
Where is the original intent of having a clean pool? Lost. What do we have now? Trainers that probably don't want to reward the dolphins' "tricks" anymore, and dolphins that will resent it if that happens. Unhappy managers, unhappy employees, wasted money and dead gulls.
The police chief wants cops to prevent accidents, but he thinks this needs to be measured: "bring me 10 speeding tickets everyday". Soon enough, instead of actually working to prevent accidents, cops will stake hot spots to catch speeding drivers and make their 10 tickets a day. Deliver me code with no bugs. Developers and testers will waste time arguing over what's a bug and what's a missing requirement and where does it get measured. Deliver on time and get a bonus. The proposed estimates will be huge, so "on time" si practically guaranteed.
KPI's without a shared moral understanding, built on trust, don't work. When everyone knows what product they're building, when everyone is in it together, when there is trust, shared vision and a common goal, yes, some measurements can be chosen to be tracked, because measuring your work needs to be done. But when measurements are enforced on people that don't share the underlying vision and don't adhere to the underlying moral code of behavior, you get perverted behavior and unintended consequences.