Buffers react with both acids and alkalis in equilibrium and when the equilibrium is tempered with (addition of acid or alkali) it will shift to reestablish the equilibrium.
So a buffer will react with acid to ensure that the pH doesn't lower and will react with alkali to ensure that the pH doesn't increase.
Hope that helps