Your observation is correct, and it's a common misconception about how refrigerators and freezers work. Coldness is indeed the absence of heat, but in the case of refrigerators and freezers, they function by removing heat from the interior to maintain a cold temperature rather than creating coldness.
Refrigerators and freezers use a closed-loop system containing refrigerant, which is a special fluid that can absorb and release heat at different temperatures. The process involves a few key components:
Compressor: The compressor compresses the refrigerant, causing its temperature and pressure to increase.
Condenser: The hot, high-pressure refrigerant gas then flows into the condenser coils located on the back or bottom of the refrigerator. The condenser coils release the heat from the refrigerant, causing it to condense into a liquid state.
Expansion valve: After the refrigerant condenses into a liquid, it passes through an expansion valve, where its pressure is reduced, and it becomes a cold, low-pressure mixture.
Evaporator: The cold refrigerant then flows into the evaporator coils located inside the freezer or refrigerator. As the warm air from the interior of the appliance comes into contact with the cold evaporator coils, the heat from the air is transferred to the refrigerant, cooling the air inside.
So, when you took out a frozen ice cream bar and held it in a warm room, the air around the ice cream bar felt cold because the ice cream bar was absorbing heat from the surrounding air. The cold refrigerant in the freezer is constantly removing heat from the interior, which is why the air around the frozen item feels cold. The process of heat transfer from the air to the ice cream bar makes it feel colder than the room temperature.
This is also why it's important to keep the refrigerator and freezer doors closed as much as possible. Every time you open the door, warm air from the room enters, and the refrigerator/freezer has to work harder to remove that heat to maintain the desired cold temperature inside.