There are also secondary enteroliths that form in the biliary system. The composition of the bile isn't quite right and the protective chemical are low so that the surfaces of the bile ducts and gallbladder are irritated causing a cox 2 reaction. Cox 2 or to give it its full name cyclooxygenase-2 is an enzyme responsible for inflammation and pain. You can turn of the pain with Cox-2 inhibiters but there are natural alternatives.
I have thought that when ones liver-flushes it not only clears out the garbage but also any protective mucus lining the bile ducts, exposing the bile ducts to the irritation of "defective bile" and this causes an increase in pain a few days later when the bile returns to full strength.