Buffers

A buffer solution contains a conjugate acid–base pair with both the acid and base in reasonable concentrations. The acidic component reacts with added strong bases. The basic component reacts with added strong acids. The operation of a buffer solution depends on the common ion effect, a special case of Le Chatelier’s Principle.

When a solution of a weak electrolyte is altered by adding one of its ions from another source, the ionization of the weak electrolyte is suppressed. This behavior is termed the common ion effect.

Weak Acids Plus Salts of Weak Acids

How do buffer solutions work?
Acidic buffer solutions
We'll take a mixture of ethanoic acid and sodium ethanoate as typical.
Ethanoic acid is a weak acid, and the position of this equilibrium will be well to the left:
HC2H3O2 (aq) + H2O (l)  C2H3O2- (aq) + H3O+ (aq)
Adding sodium ethanoate to this adds lots of extra ethanoate ions. According to Le Chatelier's Principle, that will tip the position of the equilibrium even further to the left.
The solution will therefore contain these important things:
•	lots of un-ionised ethanoic acid;
•	lots of ethanoate ions from the sodium ethanoate;
•	enough hydrogen ions to make the solution acidic.
Other things (like water and sodium ions) which are present aren't important to the argument.
Solutions that contain a weak acid plus a salt of the weak acid are always less acidic than solutions that contain the same concentration of the weak acid alone.

Adding an acid to this buffer solution
HC2H3O2 (aq) + H2O (l)  C2H3O2- (aq) + H3O+ (aq)
The buffer solution must remove most of the new hydrogen ions otherwise the pH would drop markedly.
The addition of the hydrogen ions will cause the system to be stress, and it will shift left to alleviate the stress. Hydrogen ions combine with the ethanoate ions to make ethanoic acid. This causes the reverse reaction to predominate, with the acetate ions combining with the added protons to form acetic acid. Since most of the added hydrogen ions (H+) are removed through the reverse reaction, the pH will not change very much - but because of the equilibria involved, it will fall a little bit.
Adding an alkali to this buffer solution
Alkaline solutions contain hydroxide ions and the buffer solution removes most of these ions by their combination with the hydronium ions present in the buffered system according to:
H3O+ (aq) + OH- (aq)  → 2 H2O (l)
This causes a stress on the buffered systems equilibrium, a decrease in hydronium ion concentration. The system will therefore shift to increase the hydronium ion concentration through the increased ionization of the weak acid, HC2H3O2. Due to the release of hydrogen ions, through the forward reaction, the pH will not change very much - but because of the equilibria involved, it will rise a little bit.
Buffer Capacity
Buffered systems can resist the addition of both hydronium ions or hydroxide ions, but only as long as these additions do not exceed the buffer capacity. 
•	A buffered system resists a pH change with the addition of an acid through the combination of the conjugate base (anion of a weak acid) with the added hydrogen ions (from the acid). This removal of the added H+ through the combination with the conjugate base will continue UNTIL all of the conjugate base is consumes, at which point any additional H+ that is added will cause the pH to drop
•	A buffered system resists a pH change with the addition of hydroxide by the ionization of more of the weak acid to replace any of the lost hydronium ion that combined with the added hydroxide. This replacement will continue until all of the weak acid is ionized, and then any more hydroxide added will then be able to cuase the pH to rise.