The answer is "common sense".
The initial source has to be common sense as idioms are usually metaphorical statements which make sense and relate to the common life.
In nature, birds of a solitary group do in actuality regularly frame groups. Ornithologists clarify this conduct as a 'security in numbers' strategy to diminish the danger of predation. In dialect terms, it was beforehand more typical to allude to birds flying together than flocking together and numerous early references utilize that frame.