By what mechanism does an obstructed bile duct (for example gallstones) cause steatorrhoea (excess fat in the stool)?
The function of bile produced by the liver and concentrated in the gall bladder is to aid in fat digestion. Bile acts as an emulsifier to allow the fat to be packaged into small droplets, micelles. The breakdown of fats into small micelles greatly increases the surface area for lipases produced by the pancreas have to act on. These are then absorbed across the intestinal wall.
Bile breaking down large fats into small micelles
If this first step of bile production and transport is lacking (due to liver dysfunction or obstruction anywhere in the biliary tree), the fats are not packaged into micelles and are consequently very hard to digest. They pass through the entire alimentary canal virtually undigested causing steatorrhoea, fatty, bulky and foul smelling stool.
The Biliary Tree
Gallstones 'block' the plumbing system (i.e. the biliary tree) that drains bile produced in the liver from flowing into the duodenum through the ampulla of Vater. Since bile is a dietary detergent for fats (cholesterol, triglycerides, free fatty acids), the blockage of bile impairs fat absorption in the small intestine and the fat passes into the large intestine and then into the stool. There is always a small amount of fat that passes into the feces (typically very low though), but if bile is not present to aid fat absorption then you get "fatty stool" aka steatorrhea.