There are different ways of digesting cellulose in differnt herbivores. The process of digesting cellulose is long and difficult, and requires the help of untold billions of bacteria which do the breaking down for the herbivore. Hence having a long intestine allows these microbes to act on the cellulose by producing enzyme cellulase as the food passes through it.
(Ruminants have a special stomach called rumen which are populated with billions of bacteria and protozoa, which begin breaking down the cellulose in the cell walls of plant fibers.
In herbivores the caecum is greatly enlarged and serves as a storage organ that permits bacteria and other microbes time to further digest cellulose. In other herbivores, fermentation and digestion of cellulose primarily occurs in the large intestine and cecum. The caecum and colon slows down the passage of food and allows time for the fermentation of cellulose and other plant material by symbiotic bacteria.)