…of a feather flock together
This proverb has been in use since at least the mid 16th century.
In nature, birds of a single species do in fact frequently form flocks. Ornithologists explain this behavior as a ‘safety in numbers’ tactic to reduce the risk of predation.
But it is safe to say, that this applies to humans too.
People who have similar characters or similar interests will often choose to spend time together.
P.S. In British slang, used mainly by men: Birds – refer to girls or women, especially those considered sexually attractive.