How does a buffer work?

$p H = p {K}_{a} + {\log}_{10} \left\{\frac{\left[{A}^{_}\right]}{\left[H A\right]}\right\}$
The buffer equation tells us that with appreciable concentrations of a weak acid, $H A$, and its conjugate base, ${A}^{-}$, the $p H$ of the solution should remain tolerably close to the $p {K}_{a}$ of the acid, whatever this is. Added (small) quantities of ${H}_{3} {O}^{+}$ simply protonate ${A}^{-}$; likewise, small quantities of $H {O}^{-}$ deprotonate $H A$. Free $H {O}^{-}$ and ${H}_{3} {O}^{+}$ are kept to a minimum, and the $p H$ of the solution thus changes only marginally.