The referenced study is here: Gordon Hodson and Michael A. Busser, "Bright Minds and Dark Attitudes: Lower Cognitive Ability Predicts Greater Prejudice Through Right-Wing Ideology and Low Intergroup Contact". Psych Science 2012. User March Ho also linked to a pdf.
This is a real study in a respected journal, so I'll give them the benefit of the doubt that their data collection and analysis was sound. The specific hypothesis they test is that 1) lower cognitive abilities in childhood predict higher levels of prejudice in adulthood, and 2) that this is largely because lower cognitive abilities in childhood predict a socially right-wing ideology in adulthood, which in turn predicts higher levels of prejudice. Cognitive ability is represented in terms of a "g" factor (based on previous research). They also regressed out socioeconomic status and education, so any effects should be independent of these covariates.
The data (from two UK) surveys seems to largely support their claims (Table 1). Lower cognitive abilities predict higher levels of prejudice (column c) and a more socially right-wing ideology (column a), which in turn predicts higher levels of prejudice (column b). Taking into account this "indirect" route through right-wing ideology explains most of the correlation between childhood cognitive abilities and prejudice, except in one of the four datasets (women in the BCS) (column c').
Since they are following the same subjects from childhood (10-11 years old) to adulthood (30-33 years old), they argue that this is showing a type of (weak) causation. The study is correlational and not interventional, but does show prediction longitudinally (across time).
These results from large, nationally representative data sets provide converging evidence that lower g in childhood predicts greater prejudice in adulthood and, furthermore, that socially conservative ideology mediates much of this effect. Our model tests are particularly compelling because in both the NCDS and the BCS, the measurement of childhood intelligence preceded the assessment of adulthood prejudice by at least two decades. Moreover, all predictive effects were independent of socioeconomic status and education.
They also used data from a laboratory setting in the US to come to similar conclusions, but I'll skip that since it's not part of the question.
I've tried to find specific criticism of this article, and the only page I could come up with is by William Briggs. This author does not seem to understand the results of the study, for example he states
What makes the study ludicrous, even ignoring the biases, manipulations, and qualifications just outlined, by the authors’ own admission the direct effect size for “g” on “racism” is only -0.01 for men and 0.02 for women. Utterly trivial; close enough to no effect to be no effect, their results statistically “significant” only because of the massive sample size.
This is not correct. The direct effect of "g" (cognitive ability) on racism is in fact trivial, and is not statistically significant. This is one of the main points of the study, that the effect of cognitive ability on racism is explained through the mediation of right-wing ideology (leaving little additional direct correlation between cognitive ability and racism).
Briggs does have a reasonable complaint that there was some experimental flexibility in the way the analysis was conducted, e.g.
According to the NCDS (pdf), there were about 50 questions, of which only 13 were used. A “conservative”, then, is whatever Hodson and Busseri say it is. The same thing goes for what a “racist” is.
So it is possible that the questions were cherry-picked from the survey data to give the best correlation, but without knowing a ton about the surveys it's hard to know if this could be true (are there many questions for which it is debatable whether they relate to ideology?).
Speculation about why this effect occurs is less well-founded - for example, your question about whether this has to do with "feeling safe" is not well-answered by this study. Certainly the reporting has overstated some of the conclusions and mechanisms by which this is occurring. But the study itself appears to be sound and have reasonable data in support of its conclusions. Note that the correlations they find are not massive, e.g. there are many subjects with low cognitive ability who do not end up with a conservative ideology, and many subjects with conservative ideologies who are not racially prejudiced (correlations are in the ~0.4 range). They are, however, capturing a statistically significant trend.