Who spends their time doing lots of tests? Rich kids. Being wealthy also predicts a wide variety of positive life out ones including income, health, longevity, and not being incarcerated
For example: Examining the predictive value of IQ tests between siblings in the same household (who generally have the same access to resources).
Answer: IQ remains very powerfully predictive even within a household.
A century of study and attempts at intervention have all pointed to an overwhelmingly clear result: It's not wealth that makes someone have high IQ. It's high IQ that makes people wealthy.
Children do inherit high IQ from their parents who had high IQ, but the mechanism of this isn't through wealth, it's genetic. About 80% of the variance in IQ is by genetic parentage.
Example study: Examining adoptees' IQ scores in relation to their genetic parents versus the parents who raised them. Answer: They inherit their measured IQ from their genetic parents; the adoptive parents have essentially no effect (the last 20% of variation is basically random).
IQ, more than any other psychometric measure, predicts a wide variety of positive life outcomes including income, health, longevity, not being incarcerated, etc.
Here [0] is a simplistic article about it, but there are endless studies and discussions about this, all with the same clear and uncontroversial result.
[0] https://www.cnbc.com/2022/07/11/does-iq-determine-success-a-...
Further reading:
[1] https://emilkirkegaard.dk/en/2019/07/massive-danish-sibling-...
[2] https://www.google.com/search?q=iq+predicts+success