  Recently, an alkaline earth hydride CaH$_6$ having a sodalitelike clathrate
structure has been experimentally synthesized at megabar pressures with a
maximum $T_c$ of 215 K, comparable to that of a rare earth hydride LaH$_{10}$.
Here, based on first-principles calculations, we find that CaH$_6$ exhibits a
huge peak in the Eliashberg spectral function ${\alpha}^{2}F$ around the
low-frequency region of H-derived phonon modes, in contrast to LaH$_{10}$
having a widely spreading spectrum of ${\alpha}^{2}F$ over the whole
frequencies of H-derived phonon modes. It is revealed that the huge peak of
${\alpha}^{2}F$ in CaH$_6$ is associated with an effective electron-phonon
coupling (EPC) between low-frequency optical phonons and hybridized H 1$s$ and
Ca 3$d$ states near the Fermi energy. As pressure increases, the strengthened
H$-$H covalent bonding not only induces a hardening of optical phonon modes but
also reduces the electron-phonon matrix elements related to the low-frequency
optical modes, thereby leading to a lowering of the EPC constant. It is thus
demonstrated that H-derived low-frequency phonon modes play an important role
in the pressure-induced variation of $T_c$ in CaH$_6$. Furthermore, unlike the
presence of two distinct superconducting gaps in LaH$_{10}$, CaH$_6$ is found
to exhibit a single isotropic superconducting gap.
