All human behaviors are complicated and exhibit genetic and environmental influences. It is clear that homosexuality has a strong genetic basis. Most people who are gay know it when they are young and have the same life experiences as straight people (Except for fear of coming out and discrimination for being gay). As for the complex sexuality between gay and straight that is now more out in the open, I believe it arises due to a mix of the genetics of sexual preference, other genes related to emotions and behavior, and life experiences. And one or the other may be stronger in individual people. Honestly our culture dwells on this way too much, as it does with all forms of discrimination, to the detriment of productivity. Hopefully one day we'll stop obsessing about insignificant differences among people (I.e., traits that have nothing to do with people's contribution to society).