  Black-hole (BH) binary mergers driven by gravitational perturbations of
tertiary companions constitute an important class of dynamical formation
channels for compact binaries detected by LIGO/VIRGO. Recent works have
examined numerically the combined orbital and spin dynamics of BH binaries that
undergo large Lidov-Kozai (LK) eccentricity oscillations induced by a highly
inclined companion and merge via gravitational wave radiation. However, the
extreme eccentricity variations make such systems difficult to characterize
analytically. In this paper, we develop an analytical formalism for
understanding the spin dynamics of binary BHs undergoing LK-induced mergers. We
show that, under certain conditions, the eccentricity oscillations of the
binary can be averaged over to determine the long-term behavior of the BH spin
in a smooth way. In particular, we demonstrate that the final spin-orbit
misalignment angle $\theta_{\rm sl}$ is often related to the binary's
primordial spin orientation through an approximate adiabatic invariant. Our
theory explains the "$90^\circ$ attractor" (as found in recent numerical
studies) for the evolution of $\theta_{\rm sl}$ when the initial BH spin is
aligned with the orbital axis and the octupole LK effects are negligible --
such a "$90^\circ$ attractor" would lead to a small binary effective spin
parameter $\chi_{\rm eff}\sim 0$ even for large intrinsic BH spins. We
calculate the deviation from adiabaticity in closed form as a function of the
initial conditions. We also place accurate constraints on when this adiabatic
invariant breaks down due to resonant spin-orbit interactions. We consider both
stellar-mass and supermassive BH tertiary companions, and provide simple
prescriptions for determining analytically the final spin-orbit misalignment
angles of the merging BH binaries.
