The use of herbs in cooking is usually due to what is termed a carminative effect that their volatile oils have. Volatile, or essential oils is what give these herbs their flavor and aroma. Carminatives tend to stimulate digestion and dispel gas, and some can even relieve spasms. Common carminatives include fennel, dill, ginger, peppermint and cardamom. Many times if these herbs arent used in cooking, they are introduced afterwards as teas or other alcoholic drinks.
Herbs sometimes contain mucilage causing a demulcent effect in the digestive tract. The mucilage is slimy and can act to soothe and coat the stomach and intestines. Mucilage is found in things like flax seeds, marshmallow, and aloe.