Gallstones may form if bile contains too much cholesterol, too much bilirubin, or not enough bile salts.