is partly digested food that cows bring back into their mouths after it passes through the stomach; they chew their cud to better digest their food. As cows chew and chew, they stand very still and look as if they are meditating or doing some deep thinking. That's how the phrase "chewing your cud" ties in to people when they are standing or sitting around, doing nothing but thinking.
In Babbitt, by Sinclair Lewis, George asks his wilderness guide about his dream job.
"Joe, what would you do if you had a lot of money? Would you stick to guiding, or would you take a claim 'way back in the woods and be independent of people?"
For the first time Joe brightened. He chewed his cud a second, and bubbled, "I've often thought of that! If I had the money, I'd go down to Tinker's Falls and open a swell shoe store."