Back in the fourteenth century, in Wyclif’s time, they “chewed the cud”, and we still do, in imitation of the reflective appearance of cows as they lie patiently working their jaws.
But to chew the fat, or rag, does not necessarily involve meditation; it usually involves nothing more than working the jaws in complaint, disputation, idle speech, vain argument, or just gossip. “Rag (or fat) chewing” we have had since the early 1880’s.
It was then classed as American Army slang, in Patterson’s Life in the Ranks.
To our notion, although either expression may have been adopted into army lingo, both are much more likely to have alluded to ladies’ sewing circles, to the “rags,” or cloth, upon which they worked while tongues clattered, or to the “fat,” or choice morsels of gossip, upon which they could feast.