When we place ice and water (or any combination of substances at different temperatures) into a thermally isolated container, the total energy of the ice and water doesn’t change. Instead, energy is exchanged as heat as the ice gives up energy and the water takes it in. Because the energy the ice takes in and the energy the water gives up are the same, just differing in sign, they sum to zero, meaning that the total energy of the system remains the same. Fundamentally, this means that the energy of the system that includes both the ice and the water is conserved, making calorimetry problems just another conservation of energy problem for the course.