Right, but what I wanted to highlight - a person might be able to code quick sort algorithm or breadth first search, but unable to get paid doing real world coding - when it is the client or employer who needs to be satisfied.
So basically when you have a choice of being unemployed vs doing PhD and getting some studentship, you obviously prefer the latter path.
And I believe there are quite many people who can "code" but unable to get paid.