Hormones are so much more powerful than we know, in straight as well as in gay people, in men as well as in women. So, while we do not know why someone knows that they are gay, we can assume that there is some role for hormones in sexual orientation. We just need not to judge that orientation good or bad.
In my opinion when hormones start spiking in a young teen that is when sexual orientation first becomes apparent. I feel whatever factors are around said person will become more interested in and more aroused by what they see as they are first entering puberty, as their bodies react to stimulating experiences. I feel that with these factors if a person is more prone to being around males all the time they will be more attracted to males, and vice versa with females being more attracted to females.