General intelligence is a necessary condition, but far (very, very far) from a sufficient one for being a good programmer. Most of the inept developers I've met have been smart. Intelligence wasn't the problem.
This is why I hate Java and C++. Because it's impossible to evaluate code for quality in these languages at 200-500 LoC (while you can easily do this in Python or Scala) you can't hire based on code samples. So you have to hire based on general intelligence + interviewing skill and you end up with about 15% of your team being outright duds (worse yet, intellectually brilliant and persuasive duds because they passed your hiring process, but still bad programmers and dismal architects) even if you're extremely selective.