It's the brown runny poop that stinks really bad. They do it about every 8-10 poops. If it were not from the cecal poop I don't think they would ever stink.
A chicken's intestine has two little pouchlike places called ceca (cecum, singular form). Bacteria in these pouches help to digest particularly woody, fibrous or tough bits of food that the chicken ingests. The food kind of marinates here for a while (ugh!) so the chicken can extract as much of the nutrients as possible. Chickens don't waste much!
I've often wondered whether this was the original use for our appendix.
Avian biology is fascinating to me. A few years ago when I turned 50 I bought myself a big birthday present. I got the Cornell Handbook of Bird Biology (just the book, not the course):