I learned how buffers work:
A weak acid and a salt that supplies the conjugate base ion are combined in solution. It can also be a weak base with a salt supplying the conjugate acid ion. When any acid is added, its hydronium ions combine with the conjugate base ions (or the hydroxide ions) and forces the equilibrium forward as a result, in order to compensate for the taken from the equilibrium. When a base is added, the hydroxide ions combine with the hydronium ions from the weak acid (or the conjugate acid ions from the salt), and also forces the equilibrium forward. Both these reactions are neutralization reactions and have no effect on the pH, and the equilibrium shift can compensate for these neutralized ions, which allows for the resistance to change in pH buffers are used for.
I think.