Your liver makes a digestive juice called bile. Your gallbladder stores it between meals. When you eat, your gallbladder pushes the bile into tubes called bile ducts. They carry the bile to your small intestine. The bile helps break down fat. It also helps the liver get rid of toxins and wastes.
Different diseases can block the bile ducts and cause a problem with the flow of bile:
Gallstones, which can increase pressure in the gallbladder and cause a gallbladder attack. The pain usually lasts from one to several hours.
Cancer
Infections
Birth defects, such as biliary atresia. It is the most common reason for liver transplants in children in the United States.
Inflammation, which can cause scarring. Over time, this can lead to liver failure.
NIH: National Institute of Diabetes and Digestive and Kidney Diseases