Answer:
The answer is the reward theory of attraction.
Explanation:
This theory states that people tend to be attracted to a person they associate with rewarding events, or whose behaviour they directly find rewarding. In other words, they usually stay around people who make them feel good about themselves, or remind them of other people that provoked the same feelings in them.
This might also explain why it's common for people to look for the same kind of partners ("their type") and might be repelled by different personalities.