In a famous experiment, students were asked to take a lemon home and to get used to it. Three days later, they were able to single out their lemon from a pile of rather similar ones. They seemed to have bonded.
Habit forming in humans is reflexive.
We change ourselves and our environment in order to attain maximum comfort and well being. It is the effort that goes into these adaptive processes that forms a habit. The habit is intended to prevent us from constant experimenting and risk taking. The greater our well being, the better we function and the longer we survive. Actually, when we get used to something or to someone we get used to ourselves.