The concepts are similar, but pH is specifically a measure of hydrogen ion concentration in an aqueous environment. In a non-polar hydrocarbon based lubricant, hydrogen ions don't dissociate from organic acids unless a polar solvent is present. Total Base Number refers to the mass of acid required to neutralize residual base present in an oil sample. The oil must first be diluted with a polar solvent in order to make this measurement. TBN is largely determined by the amount of detergent present in an oil and the amount of basic metal (usually calcium or magnesium) that is added. The detergents themselves are weak acids that are "over based" during formulation. The detergent package acts like a buffer and neutralize acids until the capacity is used up. This is seen as a drop in TBN. Accumulated acids can dissociate on metal surfaces in an engine and cause corrosion in the presence of moisture from combustion or condensation.