The kidneys are crucial organs for regulating the body's internal environment, including blood pH. They do this by controlling the excretion of acids and bases and regulating bicarbonate levels.