Basically, cellulose (the constituent of plant cell walls) is hard to digest (humans don't, it goes "straight through" us): as cows eat a lot of grass they have evolved (or been handed a God-given) a system for breaking it down. It's just quite complex!