Reading up on sexual identification, orientation and attraction, you would find that thee literature demonstrates that sexuality is fluidic and highly dependent on so many factors that you couldn't possibly completely identify why one person is attracted to another or vice-versa. Time, place, circumstance, mood, etc. all play a role in sexual attraction. Sometimes it's just pure dumb luck (or pure dumb fuck), and sometimes it's far more complicated.
Everyone tends to put sexuality on some type of continuum from straight to gay, even though this is not really an accurate model. It always seemed to be more random than anything else, particularly in those men and women who do not fall into the small percentages who are strictly straight or strictly gay.