What does a buffer do in a solution?
In a solution, a buffer minimises the changes in pH arising from the addition of small amounts of acid (H+) or alkali (OH-).
It does this because a buffer is a solution containing a weak acid and its conjugate base. (A conjugate base is the ion you have left when an acid has donated its H+ ion, so we can represent a weak acid as HA and the conjugate base as A-) In a mixture of the weak acid and the conjugate base we have the equilibrium HA <=> [H+] + [A-] set up.
When acid is added, the concentration of H+ increases, so the position of equilibrium moves to the left: the added H+ reacts with A- in the buffer to produce HA, and so the added H+ is removed and the change in pH is minimised.
When alkali is added, the OH- ions react with the H+ in the buffer, decreasing the concentration of H+. The position of equilibrium moves to the right, dissociating HA to produce H+ and thereby replacing it in the solution and minimising the change in pH.
Good explanation, the student can read as much as they need can be on this site http://chemwiki.ucdavis.edu/Physical_Chemistry/Acids_and_Bases/Buffers