This is an attraction by Proximity. When we pass a lot of time with another person this increases the familiarity we feel towards the other person and, finally, an attraction is generated. It also influences the fact of knowing the person better or interacting continuously with him.
I hope this information can help you.