It's not the amount. It's the ideas - getting things done. I've known programmers who can work a week on something and produce a thousand lines of convoluted code full of bugs. Someone else can come in, see the problem differently, and knock out a solution in a few dozen lines - which may have the odd bug to be ironed out, but simply due to the number of lines of code will have an order of magnitude fewer.
The ones that are 10 times more productive simply have a better grasp of which algorithm to use, as well as an in depth working knowledge of the libraries available and how to find new ones. For example, I've seen guys reinvent big wheels badly in Perl, when there are well established modules on CPAN that do the same thing and are going to be far better tested and more reliable.
The difference between average and good is in how quickly you get a reliable working system that meets the requirements. In that respect, I truly believe there is at least an order of magnitude between OK and good, let alone great, programmers.