Genetics are a big part of it, like you would expect, but its a bit more nuanced than what we learned in high school biology.