The pH of a Buffered Solution

 
Because HA is a weak acid, very little of it is dissociated at equilibrium. Even if HA were the only solute. But the solution also contains A- from the dissolved salt. The presence of A- suppresses the already slight ionization of HA by shifting the following equilibrium to the left. You should recognize this for the common ion effect which it is.
 
HA   <-------->    H+ + A-
 
ie. The value of [HA] at equilibrium = [HA] initially

and the value of [A-] at equilibrium = [A-] initially.

Therefore we can make 2 assumptions:

[HA]equilibrium = [HA]from the initial [acid] = [acid]

[A-]equilibrium = [A-]from the initial [salt] = [anion]

Therefore we can do this:

[H+] = Ka x [acid]
                   [anion]
 

If we take the -log of both sides:

-log[H+] = -log Ka + (-log  [ acid] )
                                          [anion]

pH = pKa - log   [acid]
                         [anion]
 

Since  we end up with the following:
 
(Henderson-Hasselbach Equation)
 
Two factors govern the pH in a buffered solution.
 
(1) pKa of the weak acid;
 
(2) ratio of the initial molar []'s of the acid and it's salt.
 
If we prepare a solution where [anion] = [acid] then the

log [anion] = log 1 = 0
      [acid]
 

Therefore the pH of the solution will turn out equal to the pKa of the weak acid.
 
What mostly determines where on a pH scale a buffer can work best is the pKa of the weak acid. Then by adjusting the ratio of [anion] to [acid], we can cause shifts so that the pH of the buffered solution comes out on one side or the other of this value of pH.