One notable biologist said that "the purpose of reproduction is for genes to live". That's pretty much how natural selection works. If one gene can survive more by helping millions others, it works well.. helps you in vision, shedding old skin, growing your fingernail, etc. If a gene can only exist by being malicious, you get cancer. That said, it doesn't always know what all the other genes are doing, that's what the brain is for, that's what reflexes are for, etc. It's somewhat more complicated than that, but it's pretty much a tl;dr of a few chapters of a book in evolutionary biology.
Humans sort of mess up Darwinism. We have all sorts of methods to determine the best mate. It doesn't work like animals... poor people would want to reproduce more, as more reproduction brings in more money. They also pass down more of their genes that way. Humans tend to go for loyal mates.
Rich, educated people prefer an intellectual, rich mate. You don't find some billionaire marrying some dumb blonde; he'll sleep with them, but won't take care of the kids.
Also, the cliches of women liking men with money, men liking a slim/curvaceous woman. Because those women expect the men to provide their children with plenty of resources, while the men expect the women to reproduce enough.
And interestingly, everyone has their own perception of what's attractive. People tend to go for foreigners because of genetic diversity. White men like tanned women, Asians prefer fair skinned women. Those who are already genetically diverse (mixed blood) tend to be extremely attractive to everyone. Just look at the genetic line of a lot of supermodels and actors, actresses. Good boys going for bad girls (and vice versa) works because they tend to cover each other's weaknesses and strengths.
Natural selection still shows up in humanity though, the most obvious being how some people treat their stepchildren. Stepchildren seem to have a bit of extra hostility because they take up the resources that should be given to genetic children, but not actually spread any genes. If you look at most of the horror news where parents kill their children, it's often that one of them is a step-parent.
It's still a matter of perception though. Humans tend to overthink. While our instincts are wired to appreciate the nutrients in an apple, our tongues enjoy apple-flavored juice. In the same way, we are also prone to giving adopted children, or dumb models a huge chunk of our resources even though it doesn't put us at a genetic advantage.
tl;dr: It works.