The enthalpy of formation is the change in enthalpy when one mole of a compound is formed from its elements in their standard states.
This means that when looking at how compounds are formed, we must see what the most stable form of that element is at standard temp and pressure (25 C and 1 atm), thus it equaling the standard enthalpy of formation ({delta} H subscript “f“).
The most stable forms of elements under standard conditions always have a standard enthalpy of formation of 0 (for example, O2 is 0, but O3 is 142.3).