Intense research on hybrid organic-inorganic layered copper perovskites are currently being carried out. Many interesting properties of these materials rest on the strong correlation between electronic structure and local geometry. As up to now no reliable information on the pressure dependence of Cu2+-X- distances (X = Cl, F) has been reported, we have derived them form first-principles calculations on several representative hybrid and inorganic Cu2+ layered compounds. As a salient feature, we find that in all cases the out-of-plane Cu2+-X- distance is nearly insensitive to pressure, contrary to what is found for the short and long in-plane distances. These results thus disprove the widely assumed idea that the local structure arises from a Jahn-Teller effect involving a principal axis in the layer plane. By contrast, the present work demonstrates that the ground state and the local geometry are governed by two main factors. On one hand, the axial internal electric field due to the rest of lattice ions, which favors placing the hole of the CuX64- unit in the 3z2-r2 level. On the other hand, the existence of an additional orthorhombic instability in the layer plane that nevertheless preserves the dominant 3z2-r2 character, in agreement with experimental data of pure and doped Cu2+ layered compounds. This instability is favored in pure compounds by a cooperative mechanism that is also discussed. The present calculations on these systems under pressure show that a slightly elongated CuX64- unit can also have the hole in the axial 3z2-r2 level, an unexpected situation that can only be explained with the introduction of the often ignored internal electric field.