The Henderson-Hasselbach equation is derived from the definition of the acid dissociation constant as follows.
Consider the hypothetical compound HA in water.
The acid dissociation constant of HA,
Multiply both sides of the equation by -1.
According to Henderson-Hasselbach equation, when the concentrations of the acid and the conjugate base are the same, i.e, when the acid is 50% dissociated, pH of the solution is equal to the pKa of the acid.
This relationship is used to determine the pKa of compounds experimentally.