It surprises many people to learn that all behavioural traits are heritable. From personality to intelligence to political attitudes – every one of these traits has at least some genetic component. And that genetic component is often quite large. The non-zero heritability of behavioural traits is such a consistent finding that it has been described as the First law of behaviour genetics. Of course, it isn’t really a law in the same way as the law of gravity is a law (religious affiliation might be an exception, for example), but it’s about as close as you’re going to get in the social sciences.
What does it mean to say that a trait is “heritable”? Well, the first thing to say is that heritability is a population-level statistic. It’s not a property of individuals. Educational attainment being ~50% heritable doesn’t mean that half your university degree came from your genes, and the other half came from your environment. (This wouldn’t even make sense.) What it means is that half the variation in educational attainment among individuals can be explained by genetic differences between them, and half can be explained by other factors.