As a few people have already said, it really just boils down to whether or not I feel I can talk to them. When someone isn't quite following me or just seems to be nodding along... I tend to get a little turned off and shy away. Then again, it goes the other way too. It's really difficult for me to keep up a relationship, to any degree, with someone I feel is out of my league when in terms of education or intelligence.
I think intelligence is simply a matter of perspective. When someone isn't necessarily that gifted when it comes to what we consider standard education, we might be quick to judge them as unintelligent, when it could simply be a matter of disinterest. Talk to them about something else, and their ability in it may astound, or dumbfound you. For that reason, I honestly try to keep an open mind and befriend everyone. It's only when you prove me otherwise that I'll shy away. :]