find the pH where is maximum the concentration of a amphiprotic substance
Let's take an aqueous solution of a salt $\ce{NaHA}$ with the initial concentration $C$ when added to water. It will completely dissociate  according to the eaquation: $\ce{NaHA(s) \rightarrow Na^+ +HA^-}$.

$\ce{HA^-}$ will participate in three equilibria:

$\ce{2HA^- \leftrightarrows H2A +A^{2-}\quad \quad \quad  }$ ${K_1^0=K_{A2}/K_{A1}}$

$\ce{HA^- +H2O\leftrightarrows H3O^+ +A^{2-}\quad }$ $K_2^0=K_{A2}$

$\ce{HA^- +H2O\leftrightarrows OH^- +H_2A^\quad }$ $K_3^0=K_{B1}={K_w}/{K_{A1}}$

In most cases, $K_1^0$ is far bigger than $K_2^0$ and $K_3^0$. So, the first equilibrium is the preponderant reaction, and this reaction will impose the pH of the solution.

Let's now calculate the product $K_{A2}\times K_{A1}$:

$K_{A2}\times K_{A1}= \frac{[\ce{}A^{2-}].[\ce{H3O+}]}{\ce{[HA^-]}}.\frac{[\ce{}HA^{-}].[\ce{H3O+}]}{\ce{[H_2A]}}$

According to the stoichiometry  of the preponderant reaction, we have $\ce{[A^{2-}]=[H_2A^]}$. So the product
$K_{A2}\times K_{A1}= \ce{[H3O+}]^2}$ .
i.e. $\ce{pH}=0.5(\ce{p}K_{A2} +\ce{p} K_{A1})$