Why does a buffer work best at the pH closest to its pKa? I think I'm having trouble understanding exactly how the $\mathrm{p}K_\mathrm{a}$ relates here on a conceptual level. For example I know that carbonic acid works somewhat well as a buffer at $\mathrm{pH}$ near 7, since its $\mathrm{p}K_\mathrm{a}$ is relatively close, but why is that exactly?
A buffer works best when there is the same amount of weak acid/base and its conjugate. If you look at the Henderson Hasselbalch equation, and set the concentration of the weak acid/base equal to each other, $\mathrm{pH} = \mathrm{p}K_\mathrm{a}$.