That is a tapeworm, caused by fleas. Sounds like you need to flea treat your kitty!