The gallbladder operates in a cyclic fashion: filling with hepatic bile; simultaneously concentrating the bile constituents and increasing in volume; and finally, periodically emptying the contents into the intestine. The bile constituents are predominantly cholesterol, lecithin, and bile acid salts. During this cycle, the constituents are concentrated by removing water and small electrolytes through the gallbladder wall. This flow may be assumed to form a layer of bile constituents near the wall, as it filtration were occurring at the surface. This layer will not disappear, since the constituents in the liquid diffuse only slowly away from the wall. The layer will get thicker as abstraction of water continues, decreasing the rate of water removal per unit area. However, since the volume of the gallbladder, and hence its wall area, increases with time, the total rate of water removal need not decrease. The cholesterol concentration near the bladder wall may be above saturation and cholesterol can solidify. This takes two extreme forms: microcrystals that are rapidly formed but expelled before they coagulate, and larger particles, 1-2 mm in diameter, near the wall that are not expelled but slowly grow over many cycles.
If the chemistry isn't balanced and the emptying of the gallbladder isn't effective then stones and sludge may form.
The stones in the liver-flush commonly come from the gallbladder plus those already accumulated in the intestines.
Bile salts are the most difficult chemical for the body to make and some of them take about 2 weeks to replenish after a liver-flush but may be in short supply anyway depending on ones metabolism.