  Hermite and Laguerre $\beta$-ensembles are important and well studied models
in random matrix theory with special cases $\beta=1,2,4$ corresponding to
eigenvalues of classical random matrix ensembles. It is well known that the
largest eigenvalues in these, under appropriate scaling, converge weakly to the
Tracy-Widom $\beta$ distribution whose distribution function $F_{\beta}$ has
asymptotics given by
$1-F_{\beta}(x)=\exp\left(-\frac{2\beta}{3}(1+o(1))x^{3/2}\right)$ as $x\to
\infty$ and $F_{\beta}(x)=\exp\left(-\frac{\beta}{24}(1+o(1))|x|^3\right)$ as
$x\to -\infty$. Although tail estimates for the largest eigenvalues with
correct exponents have been proved for the pre-limiting models, estimates with
matching constants had not so far been established for general $\beta$; even in
the exactly solvable cases, some of the bounds were missing. In this paper, we
prove upper and lower moderate deviation estimates for both tails with matching
constants.
  We illustrate the usefulness of these estimates by considering certain
questions in planar exponential last passage percolation (LPP), a well-studied
model in the KPZ universality class in which certain statistics have same
distributions as largest eigenvalues in Laguerre $\beta$-ensembles (for
$\beta=1,2,4$). Using our estimates in conjunction with a combination of old
and new results on the LPP geometry, we obtain three laws of iterated logarithm
including one which settles a conjecture of Ledoux (J. Theor. Probab., 2018).
We expect that the sharp moderate deviation estimates will find many further
applications in LPP problems and beyond.
