I've heard that whole black pepper is put in sauces for flavour, but it is not supposed to stay there in a finished dish, because it's quite unpleasant to bite on one during a meal. But how does one remove all of it from a sauce / gravy, especially a thick one?
As you can see, it can be useful for many things, like using the ingredients separately for other food later, or easier separation.
The same works for any food, but the mesh has to change. A tea bag, a thin cloth, any kind of mesh will work! Just make sure the holes are small enough!