The roasted coffee bean contains both soluble and insoluble components. You've most likely noticed that when you make coffee, some of the compounds from the ground coffee end up in the water, giving it the characteristic color, aroma and flavor that we know as coffee. Solubility of some of the constituents of coffee varies with the temperature of the water. Caffeine is very soluble and can be removed from coffee beans by water extraction to produce decaffeinated coffee.
The coffee grounds that remain in the filter are insoluble in water, which is why that part of the bean isn't carried through the filter paper. The coffee bean is a seed, and like most plant parts it's made up of polysaccharides (carbohydrates) that don't dissolve well. There are also traces amounts of water-insoluble oils in coffee beans that end up in the drink but float on the surface without dissolving.