It is important to avoid fatty foods after gallbladder surgery because one of the functions of the gallbladder is to store bile, which is secreted into the intestines to help break down fatty foods as they are ingested. Although bile is still made by the liver and secreted into the intestines after the gallbladder is removed, there may not be enough available at one time to adequately break down all the fats ingested in a large, fatty meal. Undigested fats in the intestines can cause diarrhea.
Most people have enough bile produced by their liver to break down fatty foods sufficiently even without a gallbladder to store it and release it as needed. Others may need to avoid fats or eat them only in small amounts after their gallbladder is removed to avoid diarrhea.