Chew the cud
To chat, in an aimless manner.
Alternative versions of this are 'chew the fat', 'chew the rag' etc. Cud is the part digested food that ruminant animals, notably cows, bring back into their mouths from their first stomach, to chew at leisure. The image is of slow and aimless mastication and the allusive use of the phrase refers to that.
In its literal sense there are references to chewing the cud' going back to Aelfric, 'De veteri et de novo testamento', circa 1000. The first recorded use of it in the allusive 'chatting' sense is in Henry Fielding's The History of Tom Jones, 1749:
"Having left her a little while to chew the cud, if I may use that expression, on these first tidings."