The most basic rule of heat transfer is that heat always flows from a warmer medium to a colder medium. Heat exchangers are devices to facilitate this heat transfer with the highest possible efficiency.
A good heat exchanger is able to transfer energy (heat) from the hot side to the cold side with small thermal losses and high efficiency. Good heat exchangers are typically small vessels with a small pressure drop, and are able to handle small temperature differences between two media.