In my career I've seen developers who were 'average' become way above average after their boss left. This was due to the weird psychological box their manager had managed to get them pinned into.
A friend of mine who is now a VC told me about dogs which were put into a box where anything they did caused the floor to shock them. Eventually they just lay on the floor quivering. This sounds horrible and cruel (and it is) and sadly I've seen managers do the same things to their people. Every time they try to do something they get yelled at, and never with any guidance just a "don't do that again!" sort of shock from the floor. Eventually they can't do anything.
It is hard to rehabilitate those people but it is possible. It takes a bit of patience to get their confidence back up that they can in fact be excellent contributors. But boy is it painful. Both for them and their new manager.
The bottom line for me is that people work at different speeds and different levels. When their tasks are well matched to their strengths they do well. I once characterized two folks I knew as a 'bubble sort' kinda guy and an 'insertion sort' kinda guy. Strangely the bubble sort guy could write code really really quickly, and that was good because he took a long time to arrive at a solid solution. The insertion sort kinda guy worked more slowly and methodically but still got to the solution in about the same amount of time. If you looked at their commit histories you might thing the insertion sort kinda guy was a 1/10th developer but if you look at the milestone delivery rate you'd see he was just as productive as the bubble sort kinda guy. Not a particularly deep insight that people are different I know.