This mixture of a weak acid (HA) and it's conjugate base (A-) acts as a buffer. A buffer is a solution with a highly stable pH. On addition of small amounts of either a strong acid or a strong base, this buffer will resist changes in pH.
Before addition:
The acid and it's conjugate base may react with each other, but this will result in no net change as both acid and base are reformed in the reaction.
HA + A- --> A- + HA
Both the acid and it's conjugate base are weak so rarely react with the water present.
As a result of both of these, the weak acid and it's conjugate base will remain in high concentration in the solution.
On addition of strong base:
As the base added is strong, it will react with the weak acid. The equation below demonstrates how the H+ from the weak acid is donated to the -OH group from the base.
-OH + HA --> A- + H2O
As the -OH group is used up by the reaction, the pH will only change minimally.
On addition of strong acid:
The H+ from the strong acid will react with the weak base to form the weak acid HA.
H+ + A- --> HA
The additional H+ contributed by adding the strong acid is mopped up by the weak base. Therefore the pH will only change minimally