  Motivated by the recent observation of superconductivity with $T_c \sim 80$ K
in pressurized La3Ni2O7 [Nature 621, 493 (2023)], we explore the structural and
electronic properties in A3Ni2O7 bilayer nickelates (A=La-Lu, Y, Sc) as a
function of hydrostatic pressure (0-150 GPa) from first principles including a
Coulomb repulsion term. At $\sim 20$ GPa, we observe an
orthorhombic-to-tetragonal transition in La$_3$Ni$_2$O$_7$ at variance with
recent x-ray diffraction data, which points to so-far unresolved complexities
at the onset of superconductivity, e.g., charge doping by variations in the
oxygen stoichiometry. We compile a structural phase diagram with particular
emphasis on the $b/a$ ratio, octahedral anisotropy, and octahedral rotations.
Intriguingly, chemical and external pressure emerge as two distinct and
counteracting control parameters. We find unexpected correlations between $T_c$
and the in-plane Ni-O-Ni bond angles for La$_3$Ni$_2$O$_7$. Moreover, two novel
structural phases with significant $c^+$ octahedral rotations and in-plane bond
disproportionations are uncovered for A=Nd-Lu, Y, Sc that exhibit a surprising
pressure-driven electronic reconstruction in the Ni $e_g$ manifold. By
disentangling the involvement of basal versus apical oxygen states at the Fermi
surface, we identify Tb$_3$Ni$_2$O$_7$ as an interesting candidate for
superconductivity at ambient pressure. These results suggest a profound
tunability of the structural and electronic phases in this novel materials
class and are key for a fundamental understanding of the superconductivity
mechanism.

Superconductivity;Materials Science