Chemical energy is the potential energy stored in the bonds of chemical compounds to undergo a transformation through a chemical reaction to transform other chemical substances. It varies due to the formation or breaking of chemical bonds of any kind in the chemical elements involved in chemical reactions. An example of chemical potential energy is the energy stored in fossil fuels.
Since the strength of chemical bonds is correlated with the distance between chemical species (in fact stronger chemical bonds keep the chemical species involved in the bond closer), the chemical energy depends on the mutual position of the particles that constitute a substance.
In other words, it is the work of the Coulomb force during the rearrangement of mutual positions of electrons and nuclei in atoms and molecules. It is, therefore, the energy stored in the chemical bonds, substantially attributable to the sum of the potential energy (of the electrostatic interactions of the charges present in the matter) and the kinetic energy of electrons.