People with similar interests, values, or even personalities tend to relate and band together, just as birds of the same feather would.
This proverb has been in use since at least the mid 16th century. In 1545 William Turner used a version of it in his papist satire The Rescuing of Romish Fox: “Byrdes of on kynde and color flok and flye allwayes together.”