There are different theories about what attracts someone to someone else. One possibility that I have heard about from a friend is that when we are very young children, the first person who treats us with exceptional kindness is a physical model for whom we will be attracted to in the future.
Let's say that we are three years old and crying over something that has dissatisfied us. And perhaps a red-headed person helps us to feel better. We will then have a positive reaction whenever we meet someone with that physical feature in the future. This might especially be true for males, since they are known to be a lot more visual than females. We might not even remember the experience, especially if we were very young, which also explains why we can't explain why we are attracted to someone. It also might explain why many men can fall in love at first sight, sight being the operative word. They are remembering the pleasurable feelings that they experienced when this type of person was exceptionally kind to them when they were little, and made them feel better.
This could also apply to both gay and straight people. Perhaps it is possible that if the first person who is exceptionally kind to you is of the same gender, you will be attracted to a same-sex partner in the future. If the first person who makes you feel better is of the opposite sex, then you will be heterosexual. I'm not saying this is the way it is; it is just an interesting theory that admittedly goes beyond what my friend originally suggested.
And on the subject of different races, perhaps if that person is of a different race, we will be more suspectible to falling in love with a person from a different race. Of course, it works both ways. Maybe one of the reasons why some people are racist is that their first negative encounter in life was with someone of a different race. Then when they meet someone in the future from that race, their mind unconsciously reverts back to the initial encounter. Again, I'm not saying this is what happens. But I think it is interesting to think about! If you're interested in other potential causes of racism, then check out this blog I wrote recently: https://jaclynhollandstrauss.com/?s=why+are+many+racist.