The mechanisms for strong electron-phonon coupling predicted for hydrogen-rich alloys with high superconducting critical temperature ($T_c$) are examined within the Migdal-Eliashberg theory. Analysis of the functional derivative of $T_c$ with respect to the electron-phonon spectral function shows that at low pressures, when the alloys often adopt layered structures, bending vibrations have the most dominant effect. At very high pressures, the H-H interactions in two-dimensional (2D) and three-dimensional (3D) extended structures are weakened, resulting in mixed bent (libration) and stretch vibrations, and the electron-phonon coupling process is distributed over a broad frequency range leading to very high $T_c$.