Good question.
I have seen Sims I've just met, and with a very low friend bar show up. I think some of it is weighted on how recently any in-house Sims interacted with the visitor Sim as well. Some Sims that have a higher friend bar can show up less if you don't interact much. Neighborhood may also matter, or maybe it makes it more likely you had a recent interaction. One legacy "spare" I moved out to next door showed up often, then less. The next time I was in Manage Worlds, I noticed the game had moved her and the niece to a house in a different neighborhood. That's what I've noticed, but it isn't really a complete answer. Sorry.