There is one hadith that some scholars have interpreted to mean that “the souls that know one another – they become friends.” This hadith has a deep meaning.
Some have said that it is about this world. The souls that connect will get along and the ones that don’t will not become friends. Other scholars have interpreted it as being about the life before this world. The souls were together and once they reach this world they join again.
There is another hadith reported by Aisha (ra) that there was a joker in Makkah, she had a reputation for cracking jokes, and when she moved to Madinah she became friends with the woman who had the same reputation in Madinah! When Aisha (ra) heard this she said “My beloved has spoken the truth” and she narrated the above hadith.