Question about the mechanics behind attraction

What wires us to find certain people attractive and not others? And why can character and personality overpower baseline attraction

There are people who are universally seen as attractive or conventionally attractive if that's what it's called, but those aren't the people I'm talking about.

I mean when you see a guy who looks like he crawled out of a sewer and he's with a princess..

I'm looking for sn answer that is not money, fame etc because although a lot of cases are like that, it's definitely not all cases.

If you know how to make someone feel good, then you win the game