D. The kidneys respond to particular acid-base imbalances by excreting or reabsorbing hydrogen ions or bicarbonate, according to the body's needs.