  The recently discovered (Li$_{0.8}$Fe$_{0.2}$)OHFeSe superconductor provides
a new platform for exploiting the microscopic mechanisms of high-$T_c$
superconductivity in FeSe-derived systems. Using density functional theory
calculations, we first show that substitution of Li by Fe not only
significantly strengthens the attraction between the (Li$_{0.8}$Fe$_{0.2}$)OH
spacing layers and the FeSe superconducting layers along the \emph{c} axis, but
also minimizes the lattice mismatch between the two in the \emph{ab} plane,
both favorable for stabilizing the overall structure. Next we explore the
electron injection into FeSe from the spacing layers, and unambiguously
identify the Fe$_{0.2}$ components to be the dominant atomic origin of the
dramatically enhanced interlayer charge transfer. We further reveal that the
system strongly favors collinear antiferromagnetic ordering in the FeSe layers,
but the spacing layers can be either antiferromagnetic or ferromagnetic
depending on the Fe$_{0.2}$ spatial distribution. Based on these
understandings, we also predict (Li$_{0.8}$Co$_{0.2}$)OHFeSe to be structurally
stable with even larger electron injection and potentially higher $T_c$.
