Bile is produced by the liver to assist in homeostasis. It is an excretory product, and is passed along the bile duct into the duodenum, where it is mixed with contents of the stomach. It contains strong alkali which neutralises the acidic food contents, enabling the enzymes in the small and large intestine work. It also contains bile salts which emulsify fats, increasing the surface area for lipases to act on, so large lumps of fat are converted to little ones.
If the bile duct gets blocked, as it can do by gall stones, bile will collect in the gall bladder, resulting in grey faeces that won't flush away. This is because they are full of fat which hasn't been emulsified by the bile, so they float. The bile pigments also can't get out, and overflow into the blood, causing the skin and the whites of the eyes to go yellow. Such is jaudice.