The story
The etymology is unknown; in English sources, references to birds passing along information to people date back to at least the 16th century (see the 1546 quotation), and in other languages even earlier. For example, Ecclesiastes 10:20 in the Bible, the original Hebrew version of which is dated to 450–180 B.C.E., states according to the King James Version (spelling modernized): “Curse not the king, no not in thy thought, and curse not the rich in thy bed-chamber: for a bird of the air shall carry the voice, and that which hath wings shall tell the matter.”
Etymology from Wiktionary, CC BY-SA 4.0.