Motivated by the recent observation of superconductivity in the pressurized trilayer Ruddlesden-Popper (RP) nickelate La4Ni3O10, we explore its structural, electronic, and magnetic properties as a function of hydrostatic pressure from first-principles calculations. We find that an orthorhombic (monoclinic)-to-tetragonal transition under pressure takes place concomitantly with the onset of superconductivity. The electronic structure of La4Ni3O10 can be understood using a molecular trimer basis wherein 𝑛 molecular subbands arise as the 𝑑𝑧2 orbitals hybridize strongly along the 𝑐 axis within the trilayer. The magnetic tendencies indicate that the ground state at ambient pressure is formed by nonmagnetic inner planes and stripe-ordered outer planes that are antiferromagnetically coupled along the 𝑐 axis, resulting in an unusual ↑, 0, ↓ stacking that is consistent with the spin density wave model previously suggested by neutron diffraction. Such a state is destabilized at the pressure where superconductivity arises. Despite the presence of 𝑑𝑧2 states at the Fermi level, the 𝑑𝑥2−𝑦2 orbitals also play a key role in the electronic structure of La4Ni3O10. This active role of the 𝑑𝑥2−𝑦2 states in the low-energy physics of the trilayer RP nickelate, together with the distinct electronic behavior of the inner and outer planes, resembles the physics of multilayer cuprates.