There are many different causes of sexuality. Take some examples from my personal experience.
As a kid, two of my mum's best friends were a lesbian couple. They had been together for years, but had both been married and had kids from their marriages. They had both been treated so badly by men that they no longer wanted relationships with men at all, and had found solace in sharing similar experiences. Of course, not all women in this situation would have sworn off men, but both felt they would never have been attracted to a woman if they had been better treated by men.
A young friend of mine told me a couple of months ago that he is gay. I have known him since he was 11, and knew almost straight away that he was gay - although he didn't realise it himself until a few months ago. I'm not sure how I knew, although he is slightly effeminate, especially his voice.
An old boyfriend of mine is bisexual, but prefers men - 70/30, he says. He is pretty masculine, although he likes to put on feminine airs, which seem very fake. This is just my theory, but as he was growing up he didn't see a lot of his dad. His main male role model was his very effeminate gay uncle. I think as this uncle was such a positive role model, my friend has gone on to emulate him, somewhat self-consciously.
Another old boyfriend that I don't like to think of too often was bisexual because he was obsessed with sex and would take it wherever he could get it - although I think he only ever fell in love with women.
A person I never suspected of being gay is an old friend from university. Although he is a bit effeminate, it never crossed my mind that he might be gay. I was always worried that he had a crush on me as I didn't find him attractive, so I was surprised when he told me he was gay. He has known for as long as he could remember.
There is a guy I work with that I had always assumed was gay, until he told me about another guy coming onto him and how he'd had to let the guy down - obviously I wasn't the only one who thought he was gay!
The point is, sometimes you can tell someone is gay, sometimes you can't, some people are born gay, some people become gay, some people are completely straight and most people probably don't even think about it - they're just attracted to who they're attracted to, and fall in love with who they fall in love with, without ever consciously thinking about gender.