The best known equation for real gases is the van der Waals equation. Real gases experience attractive forces between particles which should reduce the expected pressure they exert.
Real gases occupy volume which reduces the volume actually available to each gas particle.
To account for attraction van der Waals made the simple assumption that in order to attract, the particles must come close, and in fact collide. Energy can be transformed, but is neither created nor destroyed in chemical processes. Energy is the capacity to do work. In chemical systems we also say it is due to composition, though ultimately this reduces to positions of atoms and electrons relative to each other. Kinetic energy, potential energy, pressure, and volume are all examples of State Functions.