A kid of John Carmack is likely to have a cognitive capacity that is a standard deviation or two to the right of even the "smart" kids in class. Genetics isn't everything but it's not nothing.
See "Not in our Genes" by Lewontin, Rose, Kamin, for a thorough discussion.
In practice, it is a result based on twin studies, but with very low standards: for one thing not double-blind, definitions were let swing arbitrarily by the interviewers, and so on.
Definitions of intelligence are themselves questionable, techniques to measure it, even more so. The history of IQ has been tainted by plain fraud... And the whole field is too a succulent target for ideological warfare... truth is too easily a collateral casualty. This should not be considered science.
https://books.google.com/books?id=8zVXDwAAQBAJ&pg=PT138&lpg=...