To quote XKCD, “Correlation doesn’t imply causation, but it does waggle its eyebrows suggestively and gesture furtively while mouthing ‘look over there’.”
With that in mind, here’s Tony Piro with a chart that reflects your inner suspicions:
Keep in mind that poverty, education, ability to obtain an education, the type of IQ test used, and about 2842324 other factors play a role in how this data plays out.
And before you use this as any sort of argument against religion, remember that there are plenty of brilliant theists, just as there exist far-from-brilliant atheists.
(Thanks to Rick for the link!)