From a naive perspective, energy is energy, so melting 1 kg of ice eats 300 kJ of energy, and heating 8 kg of water from 20 C to 30C also takes 300 kJ.
But if the ambient temperature is 30 C, how much did it take to make that 1 kg of ice or that 8 kg of 20C water?
With a heat pump, like your refrigerator or freezer, producing cool water is much easier with high efficiency multipliers, while producing ice is a lot harder.
If the outside temperature is 30 C, the the ice machine radiator must be at a higher temperature, say, at 40 C, to radiate heat, and the cold end must be below freezing to actually freeze the water. So, the radiator might be at 40C and the cooler at -10 C. So, the compressor must transport the 300 kJ of heat energy "against the grain" from cool to hot, a temperature difference of 50 C.
With the refrigerator, the hot end might be at 40 C and the cool end at 10 C, meaning the difference is only 30 C.
COP or Coefficient power is the amount of energy (J) the heat engine uses to transfer 1 Joule of energy.
Some formulas:
eff = 1 - T_cold / T_hot
Refrigerator:
T_cold = 10 C = 280 K, T_hot = 40 C = 310 K
eff = 1 - 280/310 = 0.0968
COP = 1/eff = 10
Freezer:
T_cold = -10 C = 260 K, T_hot = 40 C = 310 K
eff = 1- 260/310 = 0.161
COP = 1/eff = 6.2