You know that when atoms form bonds, energy is released. Conversely, when bonds are broken, energy is absorbed. Thus when atoms combine to form compounds, energy is released because there are no bonds (assuming atoms refers to single lone atoms) being broken and only bonds being formed...