Final answer:
Bilirubin is a waste product produced by the spleen when removing old or damaged red blood cells. In the liver, it is excreted in bile and eventually transformed into a brown pigment called stercobilin, which gives stool its characteristic color.
Step-by-step explanation:
Bilirubin is a waste product produced when the spleen removes old or damaged red blood cells from the circulation. It is transported to the liver where it is excreted in bile, giving bile its green color. In the intestines, bilirubin is transformed into stercobilin, a brown pigment that gives stool its characteristic color. In some disease states, bile does not enter the intestine, resulting in white ('acholic') stool with a high fat content.