The civet isn't actually a cat, but does look similar to one. The coffee beans are indeed pooped out by the animal, which eats the fruit that surrounds the coffee beans. The beans aren't digestible however and come out mostly whole, and are then picked out by farmers and foragers, cleaned and sold.