The grapevine is a word for gossip. Anything heard on the grapevine was learned by word of mouth.
In the Civil War, a grapevine telegraph was a gadget used for communicating. From there, people started talking about "the grapevine" as a source of information, especially gossip. If you heard from a friend of a friend that another friend is getting married, you heard it on the grapevine. If your cousin's cousin told you about a family scandal, you heard it on the grapevine. The grapevine is unofficial and full of hearsay: what you hear might not be accurate.