A lonely person will be less trusting of others, essentially "making a mountain out of a molehill. An odd look or phrasing by a friend that wouldn't even be noticed by a chipper person could be seen as an affront to the lonely, triggering a cycle of negative interactions that cause people to loose friends. A lonely person is likely to lose touch with another person, who in turn gets cut off from others, and both end up on the fringes of a social group. It is more of a state such as hunger, which evolved as a cue to motivated our ancestors to go find food.
Over time, lonely individuals become lonelier and transmit such feelings to others before severing ties. "People with few friends are more likely to become lonelier over time, which then makes it less likely that they will attract or try to form new social ties.