The potential energy level of a structure or a system reflects its stability under ordinary conditions (e.g. standard temperature and pressure).The relationship is inverse. The higher the potential energy, the lower the stability of the system, and viceversa. There are many factors that affect the potential energy of a chemical structure or system. They can roughly be divided into those due to mass interactions and those due to electronic (charge) interactions.
Examples of mass interactions are steric effects. Whenever bulky groups get too close to each other a source of strain is introduced in the system and the potential energy goes up. Torsional strain is an instance of this type of interaction. Examples of electronic interactions are the repulsions between covalent bonds and lone electron pairs that compel the molecule to acquire a specific geometry in which all these entities are as far appart from each other as possible. Whenever we force these bonds to be closer to each other than in the optimal geometry, a source of strain is introduced.
Examples of charge (electrostatic) interactions are resonance structures where like charges are too close to each other. The repulsions between like charges raises the potential energy of the structure, making it into a minor contributor to the hybrid. On the other hand, the solvation process, where the partial dipoles of the solvent interact with those of the solute, but of opposite sign, results in a favorable interaction that stabilizes the system (lowers its potential energy). Hydrogen bonding is a similar interaction that brings added stability to structural arrangements such as the DNA helix and many proteins.
Resonance (electronic and charge delocalization) stabilizes a system by spreading charges and electrons over a larger area as compared to a system where electrons and charges are localized. Delocalization lowers the potential energy of the system. Finally, many chemical bonds form because the process of bond formation lowers the energy of the system compared to the isolated atoms.