Both situations involve combustion. In both cases, a material is undergoing a chemical reaction with oxygen, releasing heat and light energy. Whether it's the wick of the candle or the food in the sauce burning on the stove, the process is essentially the same: oxidation leading to combustion.