Here is a potential reason that many believers are intelligent. An intelligent person is more likely to "receive answers to their prayers." Not because there is a supreme being answering those prayers but because they are able to make things happen in their lives. They may also have better metacognitive skills and perhaps subconsciously chose to pray for things that they implicitly know are within their capabilities.
People who prayed and ended up homeless, chronically unemployed, institutionalized, or generally failures by society's standards generally do not have a voice in society. So we hear the small fraction of one percent of the population that have been "blessed"/lucky/won the genetic lottery and the other 99.99% of the population does not have a voice.
A similar situation likely occurs in those who become religious in a war zone. People return from a war zone or other calamity and recite how they prayed and their lives were spared. We do not hear about those who were "righteous" and prayed during these calamities and died because they are...well...dead.
Magic? Blessings? Nope...just luck and having a chance to talk about said luck.