All bodies radiate heat according the the black body distribution for the temperature they are at.
This radiation is energy transferred radially away from the bodies , and its magnitude is given by the Stephan Boltzmann law . The radiance (watts per square metre per steradian) is proportional to the fourth power of the temperature. Thus a colder body will radiate to the hot body much less than the hot body to the cold. As the hot body will be cooling by its radiation, the rate of cooling will be less than it would be if there were no cold radiator close to it. On the other hand as the incoming radiation from the hot body is much larger than the loss of the cold body's black body radiation, the cold body will get heated.
Maybe the quantum mechanical picture, or radiation being photons of energy h*nu will help also. Many more photons of higher energy impinge from the hot body to the cold one, than from the cold body to the hot one.
Edit after the question was made duplicate
When one is studying physics one has to keep in mind what it is all about:it is a discipline that uses mathematical models to describe and predict data/measurements. The mathematical equations used in order to do so have an unlimited number of solutions that are irrelevant and contradictory to data. Laws, postulates, principles are distillation of observations and measurements which are imposed like axioms to the mathematics, so as to pick up the subset of the functions that describe and predict measurements and observations.
In mathematics, axioms can be replaced by theorems which then are provable by the new axioms; in the same way postulates and laws and principles can be replaced by theorems , mathematical structures, but the explanation is circular, the same as replacing axioms in mathematics.
In this answer I am using data , black body radiation, to "explain" why the law had to be assumed.