Environment certainly plays a role, but to what extent? It isn't just parental involvement -- there are plenty of bright accomplished people whose parents were busy doing something else during their upbringing. It isn't likely to be the toys that you get to play with, because there are bright kids even amongst the poorest of the poor -- though they do tend to be rarer exceptions.
I'd wager my money on a higher influence from genetics than many people in our society would currently want to believe. Some people, at birth, are predisposed to certain natural talents. They simply have good spatial reasoning, for example -- it's not something that they had to learn to mimic at a young age, it's something they were actually born with.
From there, the talent is subjected to environmental conditions, some positive, some adverse. Maybe their spatial reasoning and their parents' guidance gets them into sports instead of taking things apart. Maybe their natural talents manage to survive even very adverse environments. Or, maybe the abilities just wither away and die under conditions that don't nurture them.
Seeing a good magic trick at a young age, for example, is probably what leads to true understanding of epistemology - you need that initial feeling of "reality is not what it seems". Intuitively understanding logic is also indirect - it can come from a toy peaking a child's curiosity at the just the right time in just the right way.
No learning opportunity is missed completely, just as 30-somethings can learn to speak foreign languages, but there are certainly windows for the quick acquisition of certain ideas over others.