IQ is demonstrably heritable, as is any number of different things up to and including religiosity. You are correct that random mutation ensures that the occasional genius is born even to unintelligent people. This is actually a problem in societies with high social mobility, draining intelligent people out of all demographics into comspopolitan cities where they become non-reproductive bugmen, a phenomenon known as the IQ-shredder. Demographics are not necessarily deterministic for individuals, but in the aggregate they tell a very compelling story about biodiversity between groups of humans.
I would recommend Sir Edward Dutton's Youtube channel the Jolly Heretic, where he talks frequently about the impact genes have on people's beliefs and behaviors. For example, did you know that religiosity is strongly genetically heritable? The genetic influence on whether or not you believe, and how strongly you believe, is somewhere around 50%.