I think it’s a combination of genetics and life experiences....at least in my own case.
I believe that I was born with a proclivity to be bisexual, but I was raised by parents who were straight and fairly conservative.
Had I not had a different life experience, I might have always thought of myself as straight.
However, while I was “between girlfriends”, a guy friend got naked and kissed me....and I was surprised to find myself very aroused. I knew at that point that I was not straight.
Had he not done that, I might never have stopped identifying as straight....or I might have realized much later that I was seriously sexually attracted to men as well as women.
Had I not had a proclivity to be attracted to men, I might have been repulsed rather than aroused when he kissed me.