The heater core is part of the engine cooling system and is attached to the car on the occupant's side of the firewall. Typically, the heater is a non-vital route in the cooling system and the flow of coolant can be switched on or off as needed. The core itself and the coolant lines coming out of it are typically made out of aluminum.
As the coolant passes through the heater core, the heat that was generated by the engine transfers into the metal of the heater core, which can then be transferred into the air around it, which will be moving if the blower fan motor is running.
Sometimes a heater core can be used to help reduce the overheating of an engine by sending some heat out to the cabin area, which cools the coolant passing through the heater core. The cooled fluid will travel back to the engine unless the path back is blocked. This will not prevent damage that may occur, so it should not be counted on to save an engine.