Why do I instinctively & robotically treat people I find Attractive better and nicer than people I find Ugly? Is this the same for everyone?

My brain just can't help it. If I find someone attractive I will instantly be nicer to them, engage in more conversations, and try to connect with them.

A notable thing is when I find someone Ugly I instinctively & kind of automatically give them short ended answers just to move the conversation forward and to a close.

When I have a conversation with someone I find Attractive I give MUCH more enthusiasm during the conversation, and try to connect with the person more.

I have heard this is something our ancestors have learned and passed on to us, is this true?